home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Compilers⁄Interps / GCC-2.3.3r12 / Documents-Misc / gcc.1 < prev    next >
Encoding:
Text File  |  1993-02-05  |  82.2 KB  |  3,432 lines  |  [TEXT/MPS ]

  1. .\" Copyright (c) 1991 Free Software Foundation              -*-Text-*-
  2. .\" See section COPYING for conditions for redistribution
  3. .\" FIXME: no info here on predefines.  Should there be?  extra for C++...
  4. .TH GCC 1 "28may1992" "GNU Tools" "GNU Tools"
  5. .de BP
  6. .sp
  7. .ti \-.2i
  8. \(**
  9. ..
  10. .SH NAME
  11. gcc, g++ \- GNU project C and C++ Compiler (v2 preliminary)
  12. .SH SYNOPSIS
  13. .RB gcc " [" \c
  14. .IR option " | " filename " ].\|.\|.
  15. .br
  16. .RB g++ " [" \c
  17. .IR option " | " filename " ].\|.\|.
  18. .SH WARNING
  19. The information in this man page is an extract from the full
  20. documentation of the GNU C compiler, and is limited to the meaning of
  21. the options.  This man page is not kept up to date except when
  22. volunteers want to maintain it.
  23.  
  24. For complete and current documentation, refer to the Info file `\|\c
  25. .B gcc\c
  26. \&\|' or the manual
  27. .I 
  28. Using and Porting GNU CC (for version 2.0)\c
  29. \&.  Both are made from the Texinfo source file
  30. .BR gcc.texinfo .
  31. .SH DESCRIPTION
  32. The C and C++ compilers are integrated.  Both process input files
  33. through one or more of four stages: preprocessing, compilation,
  34. assembly, and linking.  Source filename suffixes identify the source
  35. language, but which name you use for the compiler governs default
  36. assumptions:
  37. .TP
  38. .B gcc
  39. assumes preprocessed (\c
  40. .B .i\c
  41. \&) files are C and assumes C style linking.
  42. .TP
  43. .B g++
  44. assumes preprocessed (\c
  45. .B .i\c
  46. \&) files are C++ and assumes C++ style linking.
  47. .PP 
  48. Suffixes of source file names indicate the language and kind of
  49. processing to be done:
  50.  
  51. .ta \w'.cxx 'u
  52. .B .c\c
  53. \&    C source; preprocess, compile, assemble 
  54. .br
  55. .B .C\c
  56. \&    C++ source; preprocess, compile, assemble
  57. .br
  58. .B .cc\c
  59. \&    C++ source; preprocess, compile, assemble
  60. .br
  61. .B .cxx\c
  62. \&    C++ source; preprocess, compile, assemble
  63. .br
  64. .B .m\c
  65. \&    Objective-C source; preprocess, compile, assemble
  66. .br
  67. .B .i\c
  68. \&    preprocessed C; compile, assemble
  69. .br
  70. .B .ii\c
  71. \&    preprocessed C++; compile, assemble
  72. .br
  73. .B .s\c
  74. \&    Assembler source; assemble 
  75. .br
  76. .B .S\c
  77. \&    Assembler source; preprocess, assemble 
  78. .br
  79. .B .h\c
  80. \&    Preprocessor file; not usually named on command line
  81.  
  82. .I ??\c
  83. \&    Other (unrecognized) files passed to linker. 
  84. .br
  85. \&    Common cases:
  86. .br
  87. .B .o\c
  88. \&    Object file
  89. .br
  90. .B .a\c
  91. \&    Archive file
  92.  
  93. Linking is always the last stage unless you use one of the 
  94. .BR \-c ,
  95. .BR \-S ,
  96. or 
  97. .B \-E 
  98. options to avoid it (or unless compilation errors stop the whole
  99. process).  For the link stage, all 
  100. .B .o
  101. files corresponding to source files,
  102. .B \-l 
  103. libraries, unrecognized filenames (including named 
  104. .B .o
  105. object files and 
  106. .B .a 
  107. archives)
  108. are passed to the linker in command-line order.
  109.  
  110. .SH OPTIONS
  111. Options must be separate: `\|\c
  112. .B \-dr\c
  113. \&\|' is quite different from `\|\c
  114. .B \-d \-r
  115. \&\|'. 
  116.  
  117. Most `\|\c
  118. .B \-f\c
  119. \&\|' and `\|\c
  120. .B \-W\c
  121. \&\|' options have two contrary forms: 
  122. .BI \-f name
  123. and
  124. .BI \-fno\- name\c
  125. \& (or 
  126. .BI \-W name
  127. and
  128. .BI \-Wno\- name\c
  129. \&). Only the non-default forms are shown here.
  130.  
  131. Here is a summary of all the options, grouped by type.  Explanations are
  132. in the following sections.
  133.  
  134. .hy 0
  135. .na
  136. .TP
  137. .B Overall Options
  138. .br
  139. \-c
  140. \-S
  141. \-E
  142. .RI "\-o " file
  143. \-pipe
  144. \-v
  145. .RI "\-x " language
  146.  
  147. .TP
  148. .B Language Options
  149. \-ansi
  150. \-fall\-virtual
  151. \-fcond\-mismatch
  152. \-fdollars\-in\-identifiers
  153. \-fenum\-int\-equiv
  154. \-fno\-asm
  155. \-fno\-builtin
  156. \-fno\-strict\-prototype
  157. \-fsigned\-bitfields
  158. \-fsigned\-char
  159. \-fthis\-is\-variable
  160. \-funsigned\-bitfields
  161. \-funsigned\-char
  162. \-fwritable\-strings
  163. \-traditional
  164. \-traditional\-cpp
  165. \-trigraphs
  166.  
  167. .TP
  168. .B Warning Options
  169. \-fsyntax\-only
  170. \-pedantic
  171. \-pedantic\-errors
  172. \-w
  173. \-W
  174. \-Wall
  175. \-Waggregate\-return
  176. \-Wcast\-align
  177. \-Wcast\-qual
  178. \-Wcomment
  179. \-Wconversion
  180. \-Wenum\-clash
  181. \-Werror
  182. \-Wformat
  183. .RI \-Wid\-clash\- len
  184. \-Wimplicit
  185. \-Winline
  186. \-Wmissing\-prototypes
  187. \-Wparentheses
  188. \-Wpointer\-arith
  189. \-Wreturn\-type
  190. \-Wshadow
  191. \-Wstrict\-prototypes
  192. \-Wswitch
  193. \-Wtraditional
  194. \-Wtrigraphs
  195. \-Wuninitialized
  196. \-Wunused
  197. \-Wwrite\-strings
  198.  
  199. .TP
  200. .B Debugging Options
  201. \-a
  202. .RI \-d letters
  203. \-fpretend\-float
  204. \-g
  205. \-gstabs
  206. \-gdwarf
  207. \-ggdb
  208. \-gsdb
  209. \-p
  210. \-pg
  211. \-save\-temps
  212.  
  213. .TP
  214. .B Optimization Options
  215. \-fcaller\-saves
  216. \-fcse\-follow\-jumps
  217. \-fdelayed\-branch
  218. \-felide\-constructors
  219. \-fexpensive\-optimizations
  220. \-ffloat\-store
  221. \-fforce\-addr
  222. \-fforce\-mem
  223. \-finline
  224. \-finline\-functions
  225. \-fkeep\-inline\-functions
  226. \-fmemoize\-lookups
  227. \-fno\-default\-inline
  228. \-fno\-defer\-pop
  229. \-fno\-function\-cse
  230. \-fomit\-frame\-pointer
  231. \-frerun\-cse\-after\-loop
  232. \-fschedule\-insns
  233. \-fschedule\-insns2
  234. \-fstrength\-reduce
  235. \-fthread\-jumps
  236. \-funroll\-all\-loops
  237. \-funroll\-loops
  238. \-O
  239. \-O2
  240.  
  241. .TP
  242. .B Preprocessor Options
  243. \-C
  244. \-dD
  245. \-dM
  246. \-dN
  247. .RI \-D macro [\|= defn \|]
  248. \-E
  249. \-H
  250. .RI "\-i " file
  251. \-M
  252. \-MD
  253. \-MM
  254. \-MMD
  255. \-nostdinc
  256. \-P
  257. .RI \-U macro
  258. \-undef
  259.  
  260. .TP
  261. .B Linker Options
  262. .RI \-l library
  263. \-nostdlib
  264. \-static
  265.  
  266. .TP
  267. .B Directory Options
  268. .RI \-B prefix
  269. .RI \-I dir
  270. \-I\-
  271. .RI \-L dir
  272.  
  273. .TP
  274. .B Target Options
  275. .RI "\-b  " machine
  276. .RI "\-V " version
  277.  
  278. .TP
  279. .B Machine Dependent Options
  280. .I M680x0\ Options
  281. .br
  282. \-m68000
  283. \-m68020
  284. \-m68881
  285. \-mbitfield
  286. \-mc68000
  287. \-mc68020
  288. \-mfpa
  289. \-mnobitfield
  290. \-mrtd
  291. \-mshort
  292. \-msoft\-float
  293.  
  294. .I VAX Options
  295. .br
  296. \-mg
  297. \-mgnu
  298. \-munix
  299.  
  300. .I SPARC Options
  301. .br
  302. \-mfpu
  303. \-mno\-epilogue
  304.  
  305. .I Convex Options
  306. .br
  307. \-margcount
  308. \-mc1
  309. \-mc2
  310. \-mnoargcount
  311.  
  312. .I AMD29K Options
  313. .br
  314. \-m29000
  315. \-m29050
  316. \-mbw
  317. \-mdw
  318. \-mkernel\-registers
  319. \-mlarge
  320. \-mnbw
  321. \-mnodw
  322. \-msmall
  323. \-mstack\-check
  324. \-muser\-registers
  325.  
  326. .I M88K Options
  327. .br
  328. \-mbig\-pic
  329. \-mcheck\-zero\-division
  330. \-mhandle\-large\-shift
  331. \-midentify\-revision
  332. \-mno\-check\-zero\-division
  333. \-mno\-ocs\-debug\-info
  334. \-mno\-ocs\-frame\-position
  335. \-mno\-optimize\-arg\-area
  336. \-mno\-underscores
  337. \-mocs\-debug\-info
  338. \-mocs\-frame\-position
  339. \-moptimize\-arg\-area
  340. .RI \-mshort\-data\- num
  341. \-msvr3
  342. \-msvr4
  343. \-mtrap\-large\-shift
  344. \-muse\-div\-instruction
  345. \-mversion\-03.00
  346. \-mwarn\-passed\-structs
  347.  
  348. .I RS6000 Options
  349. .br
  350. \-mfp\-in\-toc
  351. \-mno\-fop\-in\-toc
  352.  
  353. .I RT Options
  354. .br
  355. \-mcall\-lib\-mul
  356. \-mfp\-arg\-in\-fpregs
  357. \-mfp\-arg\-in\-gregs
  358. \-mfull\-fp\-blocks
  359. \-mhc\-struct\-return
  360. \-min\-line\-mul
  361. \-mminimum\-fp\-blocks
  362. \-mnohc\-struct\-return
  363.  
  364. .I MIPS Options
  365. .br
  366. \-mcpu=\fIcpu type\fP
  367. \-mips2
  368. \-mips3
  369. \-mint64
  370. \-mlong64
  371. \-mlonglong128
  372. \-mmips\-as
  373. \-mgas
  374. \-mrnames
  375. \-mno\-rnames
  376. \-mgpopt
  377. \-mno\-gpopt
  378. \-mstats
  379. \-mno\-stats
  380. \-mmemcpy
  381. \-mno\-memcpy
  382. \-mno\-mips\-tfile
  383. \-mmips\-tfile
  384. \-msoft\-float
  385. \-mhard\-float
  386. \-mabicalls
  387. \-mno\-abicalls
  388. \-mhalf\-pic
  389. \-mno\-half\-pic
  390. \-G \fInum\fP
  391.  
  392. .I i386 Options
  393. .br
  394. \-m486
  395. \-mno486
  396. \-msoft\-float
  397.  
  398. .TP
  399. .B Code Generation Options
  400. .RI +e N
  401. .RI \-fcall\-saved\- reg
  402. .RI \-fcall\-used\- reg
  403. .RI \-ffixed\- reg
  404. \-fno\-common
  405. \-fno\-gnu\-binutils
  406. \-fnonnull\-objects
  407. \-fpcc\-struct\-return
  408. \-fpic
  409. \-fPIC
  410. \-fshared\-data
  411. \-fshort\-enums
  412. \-fshort\-double
  413. \-fvolatile
  414. .ad b
  415. .hy 1
  416.  
  417. .SH OVERALL OPTIONS
  418. .TP
  419. .BI "\-x " "language"
  420. Specify explicitly the 
  421. .I language\c
  422. \& for the following input files (rather than choosing a default based
  423. on the file name suffix) .  This option applies to all following input
  424. files until the next `\|\c
  425. .B \-x\c
  426. \&\|' option.  Possible values of \c
  427. .I language\c
  428. \& are
  429. `\|\c
  430. .B c\c
  431. \&\|', `\|\c
  432. .B objective\-c\c
  433. \&\|', `\|\c
  434. .B c\-header\c
  435. \&\|', `\|\c
  436. .B c++\c
  437. \&\|',
  438. `\|\c
  439. .B cpp\-output\c
  440. \&\|', `\|\c
  441. .B assembler\c
  442. \&\|', and `\|\c
  443. .B assembler\-with\-cpp\c
  444. \&\|'.
  445. .TP
  446. .B \-x none
  447. Turn off any specification of a language, so that subsequent files are
  448. handled according to their file name suffixes (as they are if `\|\c
  449. .B \-x\c
  450. \&\|'
  451. has not been used at all).
  452. .PP
  453.  
  454. If you want only some of the four stages (preprocess, compile,
  455. assemble, link), you can use
  456. `\|\c
  457. .B \-x\c
  458. \&\|' (or filename suffixes) to tell \c
  459. .B gcc\c
  460. \& where to start, and
  461. one of the options `\|\c
  462. .B \-c\c
  463. \&\|', `\|\c
  464. .B \-S\c
  465. \&\|', or `\|\c
  466. .B \-E\c
  467. \&\|' to say where
  468. \c
  469. .B gcc\c
  470. \& is to stop.  Note that some combinations (for example,
  471. `\|\c
  472. .B \-x cpp\-output \-E\c
  473. \&\|') instruct \c
  474. .B gcc\c
  475. \& to do nothing at all.
  476. .TP
  477. .B \-c
  478. Compile or assemble the source files, but do not link.  The compiler
  479. output is an object file corresponding to each source file.
  480.  
  481. By default, GCC makes the object file name for a source file by replacing
  482. the suffix `\|\c
  483. .B .c\c
  484. \&\|', `\|\c
  485. .B .i\c
  486. \&\|', `\|\c
  487. .B .s\c
  488. \&\|', etc., with `\|\c
  489. .B .o\c
  490. \&\|'.  Use
  491. .B \-o\c
  492. \& to select another name.
  493.  
  494. GCC ignores any unrecognized input files (those that do not require
  495. compilation or assembly) with the
  496. .B \-c
  497. option.
  498. .TP
  499. .B \-S
  500. Stop after the stage of compilation proper; do not assemble.  The output
  501. is an assembler code file for each non-assembler input
  502. file specified.
  503.  
  504. By default, GCC makes the assembler file name for a source file by
  505. replacing the suffix `\|\c
  506. .B .c\c
  507. \&\|', `\|\c
  508. .B .i\c
  509. \&\|', etc., with `\|\c
  510. .B .s\c
  511. \&\|'.  Use
  512. .B \-o\c
  513. \& to select another name.
  514.  
  515.  
  516. GCC ignores any input files that don't require compilation.
  517. .TP
  518. .B \-E
  519. Stop after the preprocessing stage; do not run the compiler proper.  The
  520. output is preprocessed source code, which is sent to the
  521. standard output.
  522.  
  523. GCC ignores input files which don't require preprocessing.
  524. .TP
  525. .BI "\-o " file\c
  526. \&
  527. Place output in file \c
  528. .I file\c
  529. \&.  This applies regardless to whatever
  530. sort of output GCC is producing, whether it be an executable file,
  531. an object file, an assembler file or preprocessed C code.
  532.  
  533. Since only one output file can be specified, it does not make sense to
  534. use `\|\c
  535. .B \-o\c
  536. \&\|' when compiling more than one input file, unless you are
  537. producing an executable file as output.
  538.  
  539. If you do not specify `\|\c
  540. .B \-o\c
  541. \&\|', the default is to put an executable file
  542. in `\|\c
  543. .B a.out\c
  544. \&\|', the object file for `\|\c
  545. .B \c
  546. .I source\c
  547. \&.\c
  548. .I suffix\c
  549. \&\c
  550. \&\|' in
  551. `\|\c
  552. .B \c
  553. .I source\c
  554. \&.o\c
  555. \&\|', its assembler file in `\|\c
  556. .B \c
  557. .I source\c
  558. \&.s\c
  559. \&\|', and
  560. all preprocessed C source on standard output.
  561. .TP
  562. .B \-v
  563. Print (on standard error output) the commands executed to run the stages
  564. of compilation.  Also print the version number of the compiler driver
  565. program and of the preprocessor and the compiler proper.
  566. .TP
  567. .B \-pipe
  568. Use pipes rather than temporary files for communication between the
  569. various stages of compilation.  This fails to work on some systems where
  570. the assembler cannot read from a pipe; but the GNU assembler has
  571. no trouble.
  572. .PP
  573.  
  574. .SH LANGUAGE OPTIONS
  575. The following options control the dialect of C that the compiler
  576. accepts:
  577. .TP
  578. .B \-ansi
  579. .I
  580. Support all ANSI standard C programs.  
  581. .I
  582.  
  583. This turns off certain features of GNU C that are incompatible with
  584. ANSI C, such as the \c
  585. .B asm\c
  586. \&, \c
  587. .B inline\c
  588. \& and \c
  589. .B typeof\c
  590. \&
  591. keywords, and predefined macros such as \c
  592. .B unix\c
  593. \& and \c
  594. .B vax\c
  595. \&
  596. that identify the type of system you are using.  It also enables the
  597. undesirable and rarely used ANSI trigraph feature, and makes the
  598. preprocessor accept `\|\c
  599. .B $\c
  600. \&\|' as part of identifiers.
  601.  
  602. The alternate keywords \c
  603. .B __asm__\c
  604. \&, \c
  605. .B __extension__\c
  606. \&,
  607. \c
  608. .B __inline__\c
  609. \& and \c
  610. .B __typeof__\c
  611. \& continue to work despite
  612. `\|\c
  613. .B \-ansi\c
  614. \&\|'.  You would not want to use them in an ANSI C program, of
  615. course, but it is useful to put them in header files that might be included
  616. in compilations done with `\|\c
  617. .B \-ansi\c
  618. \&\|'.  Alternate predefined macros
  619. such as \c
  620. .B __unix__\c
  621. \& and \c
  622. .B __vax__\c
  623. \& are also available, with or
  624. without `\|\c
  625. .B \-ansi\c
  626. \&\|'.
  627.  
  628. The `\|\c
  629. .B \-ansi\c
  630. \&\|' option does not cause non-ANSI programs to be
  631. rejected gratuitously.  For that, `\|\c
  632. .B \-pedantic\c
  633. \&\|' is required in
  634. addition to `\|\c
  635. .B \-ansi\c
  636. \&\|'.  
  637.  
  638. The preprocessor predefines a macro \c
  639. .B __STRICT_ANSI__\c
  640. \& when you use the `\|\c
  641. .B \-ansi\c
  642. \&\|'
  643. option.  Some header files may notice this macro and refrain
  644. from declaring certain functions or defining certain macros that the
  645. ANSI standard doesn't call for; this is to avoid interfering with any
  646. programs that might use these names for other things.
  647. .TP
  648. .B \-fno\-asm
  649. Do not recognize \c
  650. .B asm\c
  651. \&, \c
  652. .B inline\c
  653. \& or \c
  654. .B typeof\c
  655. \& as a
  656. keyword.  These words may then be used as identifiers.  You can
  657. use \c
  658. .B __asm__\c
  659. \&, \c
  660. .B __inline__\c
  661. \& and \c
  662. .B __typeof__\c
  663. \& instead.
  664. `\|\c
  665. .B \-ansi\c
  666. \&\|' implies `\|\c
  667. .B \-fno\-asm\c
  668. \&\|'.
  669. .TP
  670. .B \-fno\-builtin
  671. .I (Ignored for C++.)
  672. Don't recognize non-ANSI built-in functions.  `\|\c
  673. .B \-ansi\c
  674. \&\|' also has this
  675. effect. Currently, the only function affected is 
  676. .B alloca\c
  677. \&.
  678. .TP
  679. .B \-fno\-strict\-prototype
  680. .I
  681. (C++ only.)
  682. Consider the declaration \c
  683. .B int foo ();\c
  684. \&.  In C++, this means that the
  685. function \c
  686. .B foo\c
  687. \& takes no arguments.  In ANSI C, this is declared
  688. .B int foo(void);\c
  689. \&.  With the flag `\|\c
  690. .B \-fno\-strict\-prototype\c
  691. \&\|',
  692. declaring functions with no arguments is equivalent to declaring its
  693. argument list to be untyped, i.e., \c
  694. .B int foo ();\c
  695. \& is equivalent to
  696. saying \c
  697. .B int foo (...);\c
  698. \&.
  699. .TP
  700. .B \-trigraphs
  701. Support ANSI C trigraphs.  The `\|\c
  702. .B \-ansi\c
  703. \&\|' option implies `\|\c
  704. .B \-trigraphs\c
  705. \&\|'.
  706. .TP
  707. .B \-traditional
  708. Attempt to support some aspects of traditional C compilers.
  709. For details, see the GNU C Manual; the duplicate list here
  710. has been deleted so that we won't get complaints when it
  711. is out of date.
  712.  
  713. But one note about C++ programs only (not C).  `\|\c
  714. .B \-traditional\c
  715. \&\|' has one additional effect for C++: assignment to 
  716. .B this
  717. is permitted.  This is the same as the effect of `\|\c
  718. .B \-fthis\-is\-variable\c
  719. \&\|'.
  720. .TP
  721. .B \-traditional\-cpp
  722. Attempt to support some aspects of traditional C preprocessors.
  723. This includes the items that specifically mention the preprocessor above,
  724. but none of the other effects of `\|\c
  725. .B \-traditional\c
  726. \&\|'.
  727. .TP
  728. .B \-fdollars\-in\-identifiers
  729. .I
  730. (C++ only.)
  731. Permit the use of `\|\c
  732. .B $\c
  733. \&\|' in identifiers.   (For GNU C, this is the default, and you can
  734. forbid it with `\|\c
  735. .B \-ansi\c
  736. \&\|'.)
  737. Traditional C allowed the character `\|\c
  738. .B $\c
  739. \&\|' to form part of identifiers; by default, GNU C also
  740. allows this.  However, ANSI C forbids `\|\c
  741. .B $\c
  742. \&\|' in identifiers, and GNU C++ also forbids it by default on most
  743. platforms (though on some platforms it's enabled by default for GNU
  744. C++ as well).
  745. .TP
  746. .B \-fenum\-int\-equiv
  747. .I
  748. (C++ only.)
  749. Normally GNU C++ allows conversion of 
  750. .B enum
  751. to
  752. .B int\c
  753. \&, but not the other way around.  Use this option if you want GNU C++
  754. to allow conversion of
  755. .B int
  756. to 
  757. .B enum
  758. as well.  
  759. .TP
  760. .B \-fall\-virtual
  761. .I
  762. (C++ only.)
  763. When you use the `\|\c
  764. .B \-fall\-virtual\c
  765. \&\|', all member functions
  766. (except for constructor functions and new/delete member operators)
  767. declared in the same class with a ``method-call'' operator method are
  768. treated as virtual functions of the given class.  In effect, all
  769. of these methods become ``implicitly virtual.''
  770.  
  771. This does \c
  772. .I not\c
  773. \& mean that all calls to these methods will be made through the
  774. internal table of virtual functions.  There are some circumstances
  775. under which it is obvious that a call to a given virtual function can
  776. be made directly, and in these cases the calls still go direct.
  777.  
  778. The effect of making all methods of a class with a declared
  779. \&`\|\c
  780. .B
  781. operator->()()\c
  782. \&\|' implicitly virtual using `\|\c
  783. .B \-fall\-virtual\c
  784. \&\|' extends
  785. also to all non-constructor methods of any class derived from such a
  786. class.
  787. .TP
  788. .B \-fcond\-mismatch
  789. Allow conditional expressions with mismatched types in the second and
  790. third arguments.  The value of such an expression is void.
  791. .TP
  792. .B \-fthis\-is\-variable
  793. .I
  794. (C++ only.)
  795. The incorporation of user-defined free store management into C++ has
  796. made assignment to \c
  797. .B this\c
  798. \& an anachronism.  Therefore, by default GNU
  799. C++ treats the type of \c
  800. .B this\c
  801. \& in a member function of \c
  802. .B class X\c
  803. \&
  804. to be \c
  805. .B X *const\c
  806. \&.  In other words, it is illegal to assign to
  807. \c
  808. .B this\c
  809. \& within a class member function.  However, for backwards
  810. compatibility, you can invoke the old behavior by using
  811. \&`\|\c
  812. .B \-fthis\-is\-variable\c
  813. \&\|'.
  814. .TP
  815. .B \-funsigned\-char
  816. Let the type \c
  817. .B char\c
  818. \& be unsigned, like \c
  819. .B unsigned char\c
  820. \&.
  821.  
  822. Each kind of machine has a default for what \c
  823. .B char\c
  824. \& should
  825. be.  It is either like \c
  826. .B unsigned char\c
  827. \& by default or like
  828. \c
  829. .B signed char\c
  830. \& by default.
  831.  
  832. Ideally, a portable program should always use \c
  833. .B signed char\c
  834. \& or
  835. \c
  836. .B unsigned char\c
  837. \& when it depends on the signedness of an object.
  838. But many programs have been written to use plain \c
  839. .B char\c
  840. \& and
  841. expect it to be signed, or expect it to be unsigned, depending on the
  842. machines they were written for.  This option, and its inverse, let you
  843. make such a program work with the opposite default.
  844.  
  845. The type \c
  846. .B char\c
  847. \& is always a distinct type from each of
  848. \c
  849. .B signed char\c
  850. \& and \c
  851. .B unsigned char\c
  852. \&, even though its behavior
  853. is always just like one of those two.
  854.  
  855. .TP
  856. .B \-fsigned\-char
  857. Let the type \c
  858. .B char\c
  859. \& be signed, like \c
  860. .B signed char\c
  861. \&.
  862.  
  863. Note that this is equivalent to `\|\c
  864. .B \-fno\-unsigned\-char\c
  865. \&\|', which is
  866. the negative form of `\|\c
  867. .B \-funsigned\-char\c
  868. \&\|'.  Likewise,
  869. `\|\c
  870. .B \-fno\-signed\-char\c
  871. \&\|' is equivalent to `\|\c
  872. .B \-funsigned\-char\c
  873. \&\|'.
  874. .TP
  875. .B \-fsigned\-bitfields
  876. .TP
  877. .B \-funsigned\-bitfields
  878. .TP
  879. .B \-fno\-signed\-bitfields
  880. .TP
  881. .B \-fno\-unsigned\-bitfields
  882. These options control whether a bitfield is
  883. signed or unsigned, when declared with no explicit `\|\c
  884. .B signed\c
  885. \&\|' or `\|\c
  886. .B unsigned\c
  887. \&\|' qualifier.  By default, such a bitfield is
  888. signed, because this is consistent: the basic integer types such as
  889. \c
  890. .B int\c
  891. \& are signed types.
  892.  
  893. However, when you specify `\|\c
  894. .B \-traditional\c
  895. \&\|', bitfields are all unsigned
  896. no matter what.
  897. .TP
  898. .B \-fwritable\-strings
  899. Store string constants in the writable data segment and don't uniquize
  900. them.  This is for compatibility with old programs which assume they
  901. can write into string constants.  `\|\c
  902. .B \-traditional\c
  903. \&\|' also has this
  904. effect.
  905.  
  906. Writing into string constants is a very bad idea; ``constants'' should
  907. be constant.
  908. .PP
  909.  
  910. .SH PREPROCESSOR OPTIONS
  911. These options control the C preprocessor, which is run on each C source
  912. file before actual compilation.
  913.  
  914. If you use the `\|\c
  915. .B \-E\c
  916. \&\|' option, GCC does nothing except preprocessing.
  917. Some of these options make sense only together with `\|\c
  918. .B \-E\c
  919. \&\|' because
  920. they cause the preprocessor output to be unsuitable for actual
  921. compilation.
  922. .TP
  923. .BI "\-i " file\c
  924. \&
  925. Process \c
  926. .I file\c
  927. \& as input, discarding the resulting output, before
  928. processing the regular input file.  Because the output generated from
  929. \c
  930. .I file\c
  931. \& is discarded, the only effect of `\|\c
  932. .B \-i \c
  933. .I file\c
  934. \&\c
  935. \&\|' is to
  936. make the macros defined in \c
  937. .I file\c
  938. \& available for use in the main
  939. input.  The preprocessor evaluates any `\|\c
  940. .B \-D\c
  941. \&\|' and `\|\c
  942. .B \-U\c
  943. \&\|' options
  944. on the command line before processing `\|\c
  945. .B \-i\c
  946. \&\|' \c
  947. .I file\c
  948. \&.
  949. .TP
  950. .B \-nostdinc
  951. Do not search the standard system directories for header files.  Only
  952. the directories you have specified with `\|\c
  953. .B \-I\c
  954. \&\|' options (and the
  955. current directory, if appropriate) are searched.   
  956.  
  957. By using both `\|\c
  958. .B \-nostdinc\c
  959. \&\|' and `\|\c
  960. .B \-I\-\c
  961. \&\|', you can limit the include-file search file to only those
  962. directories you specify explicitly.
  963. .TP
  964. .B \-undef
  965. Do not predefine any nonstandard macros.  (Including architecture flags).
  966. .TP
  967. .B \-E
  968. Run only the C preprocessor.  Preprocess all the C source files
  969. specified and output the results to standard output or to the
  970. specified output file.
  971. .TP
  972. .B \-C
  973. Tell the preprocessor not to discard comments.  Used with the
  974. `\|\c
  975. .B \-E\c
  976. \&\|' option.
  977. .TP
  978. .B \-P
  979. Tell the preprocessor not to generate `\|\c
  980. .B #line\c
  981. \&\|' commands.
  982. Used with the `\|\c
  983. .B \-E\c
  984. \&\|' option.
  985. .TP
  986. .B \-M
  987. Tell the preprocessor to output a rule suitable for \c
  988. .B make\c
  989. \&
  990. describing the dependencies of each object file.  For each source file,
  991. the preprocessor outputs one \c
  992. .B make\c
  993. \&-rule whose target is the object
  994. file name for that source file and whose dependencies are all the files
  995. `\|\c
  996. .B #include\c
  997. \&\|'d in it.  This rule may be a single line or may be
  998. continued with `\|\c
  999. .B \e\c
  1000. \&\|'-newline if it is long.  The list of rules is
  1001. printed on standard output instead of the preprocessed C program.
  1002.  
  1003. `\|\c
  1004. .B \-M\c
  1005. \&\|' implies `\|\c
  1006. .B \-E\c
  1007. \&\|'.
  1008. .TP
  1009. .B \-MM
  1010. Like `\|\c
  1011. .B \-M\c
  1012. \&\|' but the output mentions only the user header files
  1013. included with `\|\c
  1014. .B #include "\c
  1015. .I file\c
  1016. \&"\c
  1017. \&\|'.  System header files
  1018. included with `\|\c
  1019. .B #include <\c
  1020. .I file\c
  1021. \&>\c
  1022. \&\|' are omitted.
  1023. .TP
  1024. .B \-MD
  1025. Like `\|\c
  1026. .B \-M\c
  1027. \&\|' but the dependency information is written to files with
  1028. names made by replacing `\|\c
  1029. .B .c\c
  1030. \&\|' with `\|\c
  1031. .B .d\c
  1032. \&\|' at the end of the
  1033. input file names.  This is in addition to compiling the file as
  1034. specified\(em\&`\|\c
  1035. .B \-MD\c
  1036. \&\|' does not inhibit ordinary compilation the way
  1037. `\|\c
  1038. .B \-M\c
  1039. \&\|' does.
  1040.  
  1041. The Mach utility `\|\c
  1042. .B md\c
  1043. \&\|' can be used to merge the `\|\c
  1044. .B .d\c
  1045. \&\|' files
  1046. into a single dependency file suitable for using with the `\|\c
  1047. .B make\c
  1048. \&\|'
  1049. command.
  1050. .TP
  1051. .B \-MMD
  1052. Like `\|\c
  1053. .B \-MD\c
  1054. \&\|' except mention only user header files, not system
  1055. header files.
  1056. .TP
  1057. .B \-H
  1058. Print the name of each header file used, in addition to other normal
  1059. activities.
  1060. .TP
  1061. .BI \-D macro
  1062. Define macro \c
  1063. .I macro\c
  1064. \& with the string `\|\c
  1065. .B 1\c
  1066. \&\|' as its definition.
  1067. .TP
  1068. .BI \-D macro = defn
  1069. Define macro \c
  1070. .I macro\c
  1071. \& as \c
  1072. .I defn\c
  1073. \&.    All instances of `\|\c
  1074. .B \-D\c
  1075. \&\|' on
  1076. the command line are processed before any `\|\c
  1077. .B \-U\c
  1078. \&\|' or `\|\c
  1079. .B \-i\c
  1080. \&\|' options.
  1081. .TP
  1082. .BI \-U macro
  1083. Undefine macro \c
  1084. .I macro\c
  1085. \&.  `\|\c
  1086. .B \-U\c
  1087. \&\|' options are evaluated after all `\|\c
  1088. .B \-D\c
  1089. \&\|' options, but before any `\|\c
  1090. .B \-i\c
  1091. \&\|' options.
  1092. .TP
  1093. .B \-dM
  1094. Tell the preprocessor to output only a list of the macro definitions
  1095. that are in effect at the end of preprocessing.  Used with the `\|\c
  1096. .B \-E\c
  1097. \&\|'
  1098. option.
  1099. .TP
  1100. .B \-dD
  1101. Tell the preprocessing to pass all macro definitions into the output, in
  1102. their proper sequence in the rest of the output.
  1103. .TP
  1104. .B \-dN
  1105. Like `\|\c
  1106. .B \-dD\c
  1107. \&\|' except that the macro arguments and contents are omitted.
  1108. Only `\|\c
  1109. .B #define \c
  1110. .I name\c
  1111. \&\c
  1112. \&\|' is included in the output.
  1113. .PP
  1114.  
  1115. .SH LINKER OPTIONS
  1116. These options come into play when the compiler links object files into
  1117. an executable output file.  They are meaningless if the compiler is
  1118. not doing a link step.
  1119. .TP
  1120. .I object-file-name
  1121. A file name that does not end in a special recognized suffix is
  1122. considered to name an object file or library.  (Object files are
  1123. distinguished from libraries by the linker according to the file
  1124. contents.)  If GCC does a link step, these object files are used as input
  1125. to the linker.
  1126. .TP
  1127. .BI \-l library\c
  1128. \&
  1129. Use the library named \c
  1130. .I library\c
  1131. \& when linking.
  1132.  
  1133. The linker searches a standard list of directories for the library,
  1134. which is actually a file named `\|\c
  1135. .B lib\c
  1136. .I library\c
  1137. \&.a\c
  1138. \&\|'.  The linker
  1139. then uses this file as if it had been specified precisely by name.
  1140.  
  1141. The directories searched include several standard system directories
  1142. plus any that you specify with `\|\c
  1143. .B \-L\c
  1144. \&\|'.
  1145.  
  1146. Normally the files found this way are library files\(em\&archive files
  1147. whose members are object files.  The linker handles an archive file by
  1148. scanning through it for members which define symbols that have so far
  1149. been referenced but not defined.  However, if the linker finds an
  1150. ordinary object file rather than a library, the object file is linked
  1151. in the usual fashion.  The only difference between using an `\|\c
  1152. .B \-l\c
  1153. \&\|' option and specifying a file
  1154. name is that `\|\c
  1155. .B \-l\c
  1156. \&\|' surrounds 
  1157. .I library
  1158. with `\|\c
  1159. .B lib\c
  1160. \&\|' and `\|\c
  1161. .B .a\c
  1162. \&\|' and searches several directories.
  1163. .TP
  1164. .B \-nostdlib
  1165. Don't use the standard system libraries and startup files when linking.
  1166. Only the files you specify will be passed to the linker.
  1167. .TP
  1168. .B \-static
  1169. On systems that support dynamic linking, this prevents linking with the shared
  1170. libraries.  On other systems, this option has no effect.
  1171. .PP
  1172.  
  1173. .SH DIRECTORY OPTIONS
  1174. These options specify directories to search for header files, for
  1175. libraries and for parts of the compiler:
  1176. .TP
  1177. .BI "\-I" "dir"\c
  1178. \&
  1179. Append directory \c
  1180. .I dir\c
  1181. \& to the list of directories searched for include files.
  1182. .TP
  1183. .B \-I\-
  1184. Any directories you specify with `\|\c
  1185. .B \-I\c
  1186. \&\|' options before the `\|\c
  1187. .B \-I\-\c
  1188. \&\|'
  1189. option are searched only for the case of `\|\c
  1190. .B 
  1191. #include "\c
  1192. .I file\c
  1193. .B
  1194. \&"\c
  1195. \&\|';
  1196. they are not searched for `\|\c
  1197. .B #include <\c
  1198. .I file\c
  1199. \&>\c
  1200. \&\|'.
  1201.  
  1202. If additional directories are specified with `\|\c
  1203. .B \-I\c
  1204. \&\|' options after
  1205. the `\|\c
  1206. .B \-I\-\c
  1207. \&\|', these directories are searched for all `\|\c
  1208. .B #include\c
  1209. \&\|'
  1210. directives.  (Ordinarily \c
  1211. .I all\c
  1212. \& `\|\c
  1213. .B \-I\c
  1214. \&\|' directories are used
  1215. this way.)
  1216.  
  1217. In addition, the `\|\c
  1218. .B \-I\-\c
  1219. \&\|' option inhibits the use of the current
  1220. directory (where the current input file came from) as the first search
  1221. directory for `\|\c
  1222. .B 
  1223. #include "\c
  1224. .I file\c
  1225. .B
  1226. \&"\c
  1227. \&\|'.  There is no way to
  1228. override this effect of `\|\c
  1229. .B \-I\-\c
  1230. \&\|'.  With `\|\c
  1231. .B \-I.\c
  1232. \&\|' you can specify
  1233. searching the directory which was current when the compiler was
  1234. invoked.  That is not exactly the same as what the preprocessor does
  1235. by default, but it is often satisfactory.
  1236.  
  1237. `\|\c
  1238. .B \-I\-\c
  1239. \&\|' does not inhibit the use of the standard system directories
  1240. for header files.  Thus, `\|\c
  1241. .B \-I\-\c
  1242. \&\|' and `\|\c
  1243. .B \-nostdinc\c
  1244. \&\|' are
  1245. independent.
  1246. .TP
  1247. .BI "\-L" "dir"\c
  1248. \&
  1249. Add directory \c
  1250. .I dir\c
  1251. \& to the list of directories to be searched
  1252. for `\|\c
  1253. .B \-l\c
  1254. \&\|'.
  1255. .TP
  1256. .BI "\-B" "prefix"\c
  1257. \&
  1258. This option specifies where to find the executables, libraries and
  1259. data files of the compiler itself.
  1260.  
  1261. The compiler driver program runs one or more of the subprograms
  1262. `\|\c
  1263. .B cpp\c
  1264. \&\|', `\|\c
  1265. .B cc1\c
  1266. \&\|' (or, for C++, `\|\c
  1267. .B cc1plus\c
  1268. \&\|'), `\|\c
  1269. .B as\c
  1270. \&\|' and `\|\c
  1271. .B ld\c
  1272. \&\|'.  It tries
  1273. \c
  1274. .I prefix\c
  1275. \& as a prefix for each program it tries to run, both with and
  1276. without `\|\c
  1277. .B \c
  1278. .I machine\c
  1279. \&/\c
  1280. .I version\c
  1281. \&/\c
  1282. \&\|'.
  1283.  
  1284. For each subprogram to be run, the compiler driver first tries the
  1285. `\|\c
  1286. .B \-B\c
  1287. \&\|' prefix, if any.  If that name is not found, or if `\|\c
  1288. .B \-B\c
  1289. \&\|'
  1290. was not specified, the driver tries two standard prefixes, which are
  1291. `\|\c
  1292. .B /usr/lib/gcc/\c
  1293. \&\|' and `\|\c
  1294. .B /usr/local/lib/gcc-lib/\c
  1295. \&\|'.  If neither of
  1296. those results in a file name that is found, the compiler driver
  1297. searches for the unmodified program
  1298. name, using the directories specified in your
  1299. `\|\c
  1300. .B PATH\c
  1301. \&\|' environment variable.
  1302.  
  1303. The run-time support file `\|\c
  1304. .B libgcc.a\c
  1305. \&\|' is also searched for using the
  1306. `\|\c
  1307. .B \-B\c
  1308. \&\|' prefix, if needed.  If it is not found there, the two
  1309. standard prefixes above are tried, and that is all.  The file is left
  1310. out of the link if it is not found by those means.  Most of the time,
  1311. on most machines, `\|\c
  1312. .B libgcc.a\c
  1313. \&\|' is not actually necessary.
  1314.  
  1315. You can get a similar result from the environment variable
  1316. \c
  1317. .B GCC_EXEC_PREFIX\c
  1318. \&; if it is defined, its value is used as a prefix
  1319. in the same way.  If both the `\|\c
  1320. .B \-B\c
  1321. \&\|' option and the
  1322. \c
  1323. .B GCC_EXEC_PREFIX\c
  1324. \& variable are present, the `\|\c
  1325. .B \-B\c
  1326. \&\|' option is
  1327. used first and the environment variable value second.
  1328. .PP
  1329.  
  1330. .SH WARNING OPTIONS
  1331. Warnings are diagnostic messages that report constructions which
  1332. are not inherently erroneous but which are risky or suggest there
  1333. may have been an error.
  1334.  
  1335. These options control the amount and kinds of warnings produced by GNU
  1336. CC:
  1337. .TP
  1338. .B \-fsyntax\-only
  1339. Check the code for syntax errors, but don't emit any output.
  1340. .TP
  1341. .B \-w
  1342. Inhibit all warning messages.
  1343. .TP
  1344. .B \-pedantic
  1345. Issue all the warnings demanded by strict ANSI standard C; reject
  1346. all programs that use forbidden extensions.
  1347.  
  1348. Valid ANSI standard C programs should compile properly with or without
  1349. this option (though a rare few will require `\|\c
  1350. .B \-ansi\c
  1351. \&\|').  However,
  1352. without this option, certain GNU extensions and traditional C features
  1353. are supported as well.  With this option, they are rejected.  There is
  1354. no reason to \c
  1355. .I use\c
  1356. \& this option; it exists only to satisfy pedants.
  1357.  
  1358. `\|\c
  1359. .B \-pedantic\c
  1360. \&\|' does not cause warning messages for use of the
  1361. alternate keywords whose names begin and end with `\|\c
  1362. .B __\c
  1363. \&\|'.  Pedantic
  1364. warnings are also disabled in the expression that follows
  1365. \c
  1366. .B __extension__\c
  1367. \&.  However, only system header files should use
  1368. these escape routes; application programs should avoid them.
  1369. .TP
  1370. .B \-pedantic\-errors
  1371. Like `\|\c
  1372. .B \-pedantic\c
  1373. \&\|', except that errors are produced rather than
  1374. warnings.
  1375. .TP
  1376. .B \-W
  1377. Print extra warning messages for these events:
  1378. .TP
  1379. \ \ \ \(bu
  1380. A nonvolatile automatic variable might be changed by a call to
  1381. \c
  1382. .B longjmp\c
  1383. \&.  These warnings are possible only in
  1384. optimizing compilation.
  1385.  
  1386. The compiler sees only the calls to \c
  1387. .B setjmp\c
  1388. \&.  It cannot know
  1389. where \c
  1390. .B longjmp\c
  1391. \& will be called; in fact, a signal handler could
  1392. call it at any point in the code.  As a result, you may get a warning
  1393. even when there is in fact no problem because \c
  1394. .B longjmp\c
  1395. \& cannot
  1396. in fact be called at the place which would cause a problem.
  1397. .TP
  1398. \ \ \ \(bu
  1399. A function can return either with or without a value.  (Falling
  1400. off the end of the function body is considered returning without
  1401. a value.)  For example, this function would evoke such a
  1402. warning:
  1403. .sp
  1404. .br
  1405. foo\ (a)
  1406. .br
  1407. {
  1408. .br
  1409. \ \ if\ (a\ >\ 0)
  1410. .br
  1411. \ \ \ \ return\ a;
  1412. .br
  1413. }
  1414. .br
  1415. .sp
  1416.  
  1417. Spurious warnings can occur because GNU CC does not realize that
  1418. certain functions (including \c
  1419. .B abort\c
  1420. \& and \c
  1421. .B longjmp\c
  1422. \&)
  1423. will never return.
  1424. .TP
  1425. \ \ \ \(bu
  1426. An expression-statement contains no side effects.
  1427. .TP
  1428. \ \ \ \(bu
  1429. An unsigned value is compared against zero with `\|\c
  1430. .B >\c
  1431. \&\|' or `\|\c
  1432. .B <=\c
  1433. \&\|'.
  1434. .PP
  1435. .TP
  1436. .B \-Wimplicit
  1437. Warn whenever a function or parameter is implicitly declared.
  1438. .TP
  1439. .B \-Wreturn\-type
  1440. Warn whenever a function is defined with a return-type that defaults
  1441. to \c
  1442. .B int\c
  1443. \&.  Also warn about any \c
  1444. .B return\c
  1445. \& statement with no
  1446. return-value in a function whose return-type is not \c
  1447. .B void\c
  1448. \&.
  1449. .TP
  1450. .B \-Wunused
  1451. Warn whenever a local variable is unused aside from its declaration,
  1452. whenever a function is declared static but never defined, and whenever
  1453. a statement computes a result that is explicitly not used.
  1454. .TP
  1455. .B \-Wswitch
  1456. Warn whenever a \c
  1457. .B switch\c
  1458. \& statement has an index of enumeral type
  1459. and lacks a \c
  1460. .B case\c
  1461. \& for one or more of the named codes of that
  1462. enumeration.  (The presence of a \c
  1463. .B default\c
  1464. \& label prevents this
  1465. warning.)  \c
  1466. .B case\c
  1467. \& labels outside the enumeration range also
  1468. provoke warnings when this option is used.
  1469. .TP
  1470. .B \-Wcomment
  1471. Warn whenever a comment-start sequence `\|\c
  1472. .B /*\c
  1473. \&\|' appears in a comment.
  1474. .TP
  1475. .B \-Wtrigraphs
  1476. Warn if any trigraphs are encountered (assuming they are enabled).
  1477. .TP
  1478. .B \-Wformat
  1479. Check calls to \c
  1480. .B printf\c
  1481. \& and \c
  1482. .B scanf\c
  1483. \&, etc., to make sure that
  1484. the arguments supplied have types appropriate to the format string
  1485. specified.
  1486. .TP
  1487. .B \-Wuninitialized
  1488. An automatic variable is used without first being initialized.
  1489.  
  1490. These warnings are possible only in optimizing compilation,
  1491. because they require data flow information that is computed only
  1492. when optimizing.  If you don't specify `\|\c
  1493. .B \-O\c
  1494. \&\|', you simply won't
  1495. get these warnings.
  1496.  
  1497. These warnings occur only for variables that are candidates for
  1498. register allocation.  Therefore, they do not occur for a variable that
  1499. is declared \c
  1500. .B volatile\c
  1501. \&, or whose address is taken, or whose size
  1502. is other than 1, 2, 4 or 8 bytes.  Also, they do not occur for
  1503. structures, unions or arrays, even when they are in registers.
  1504.  
  1505. Note that there may be no warning about a variable that is used only
  1506. to compute a value that itself is never used, because such
  1507. computations may be deleted by data flow analysis before the warnings
  1508. are printed.
  1509.  
  1510. These warnings are made optional because GNU CC is not smart
  1511. enough to see all the reasons why the code might be correct
  1512. despite appearing to have an error.  Here is one example of how
  1513. this can happen:
  1514.  
  1515. .sp
  1516. .br
  1517. {
  1518. .br
  1519. \ \ int\ x;
  1520. .br
  1521. \ \ switch\ (y)
  1522. .br
  1523. \ \ \ \ {
  1524. .br
  1525. \ \ \ \ case\ 1:\ x\ =\ 1;
  1526. .br
  1527. \ \ \ \ \ \ break;
  1528. .br
  1529. \ \ \ \ case\ 2:\ x\ =\ 4;
  1530. .br
  1531. \ \ \ \ \ \ break;
  1532. .br
  1533. \ \ \ \ case\ 3:\ x\ =\ 5;
  1534. .br
  1535. \ \ \ \ }
  1536. .br
  1537. \ \ foo\ (x);
  1538. .br
  1539. }
  1540. .br
  1541. .sp
  1542.  
  1543.  
  1544. If the value of \c
  1545. .B y\c
  1546. \& is always 1, 2 or 3, then \c
  1547. .B x\c
  1548. \& is
  1549. always initialized, but GNU CC doesn't know this.  Here is
  1550. another common case:
  1551.  
  1552. .sp
  1553. .br
  1554. {
  1555. .br
  1556. \ \ int\ save_y;
  1557. .br
  1558. \ \ if\ (change_y)\ save_y\ =\ y,\ y\ =\ new_y;
  1559. .br
  1560. \ \ .\|.\|.
  1561. .br
  1562. \ \ if\ (change_y)\ y\ =\ save_y;
  1563. .br
  1564. }
  1565. .br
  1566. .sp
  1567.  
  1568.  
  1569. This has no bug because \c
  1570. .B save_y\c
  1571. \& is used only if it is set.
  1572.  
  1573. Some spurious warnings can be avoided if you declare as
  1574. \c
  1575. .B volatile\c
  1576. \& all the functions you use that never return.
  1577. .TP
  1578. .B \-Wparentheses
  1579. Warn if parentheses are omitted in certain contexts.
  1580. .TP
  1581. .B \-Wall
  1582. All of the above `\|\c
  1583. .B \-W\c
  1584. \&\|' options combined.  These are all the
  1585. options which pertain to usage that we recommend avoiding and that we
  1586. believe is easy to avoid, even in conjunction with macros.
  1587. .PP
  1588.  
  1589. The remaining `\|\c
  1590. .B \-W.\|.\|.\c
  1591. \&\|' options are not implied by `\|\c
  1592. .B \-Wall\c
  1593. \&\|'
  1594. because they warn about constructions that we consider reasonable to
  1595. use, on occasion, in clean programs.
  1596. .TP
  1597. .B \-Wtraditional
  1598. Warn about certain constructs that behave differently in traditional and
  1599. ANSI C.
  1600. .TP
  1601. \ \ \ \(bu
  1602. Macro arguments occurring within string constants in the macro body.
  1603. These would substitute the argument in traditional C, but are part of
  1604. the constant in ANSI C.
  1605. .TP
  1606. \ \ \ \(bu
  1607. A function declared external in one block and then used after the end of
  1608. the block.
  1609. .TP
  1610. \ \ \ \(bu
  1611. A \c
  1612. .B switch\c
  1613. \& statement has an operand of type \c
  1614. .B long\c
  1615. \&.
  1616. .PP
  1617. .TP
  1618. .B \-Wshadow
  1619. Warn whenever a local variable shadows another local variable.
  1620. .TP
  1621. .BI "\-Wid\-clash\-" "len"\c
  1622. \&
  1623. Warn whenever two distinct identifiers match in the first \c
  1624. .I len\c
  1625. \&
  1626. characters.  This may help you prepare a program that will compile
  1627. with certain obsolete, brain-damaged compilers.
  1628. .TP
  1629. .B \-Wpointer\-arith
  1630. Warn about anything that depends on the ``size of'' a function type or
  1631. of \c
  1632. .B void\c
  1633. \&.  GNU C assigns these types a size of 1, for
  1634. convenience in calculations with \c
  1635. .B void *\c
  1636. \& pointers and pointers
  1637. to functions.
  1638. .TP
  1639. .B \-Wcast\-qual
  1640. Warn whenever a pointer is cast so as to remove a type qualifier from
  1641. the target type.  For example, warn if a \c
  1642. .B const char *\c
  1643. \& is cast
  1644. to an ordinary \c
  1645. .B char *\c
  1646. \&.
  1647. .TP
  1648. .B \-Wcast\-align
  1649. Warn whenever a pointer is cast such that the required alignment of the
  1650. target is increased.  For example, warn if a \c
  1651. .B char *\c
  1652. \& is cast to
  1653. an \c
  1654. .B int *\c
  1655. \& on machines where integers can only be accessed at
  1656. two- or four-byte boundaries.
  1657. .TP
  1658. .B \-Wwrite\-strings
  1659. Give string constants the type \c
  1660. .B const char[\c
  1661. .I length\c
  1662. \&]\c
  1663. \& so that
  1664. copying the address of one into a non-\c
  1665. .B const\c
  1666. \& \c
  1667. .B char *\c
  1668. \&
  1669. pointer will get a warning.  These warnings will help you find at
  1670. compile time code that can try to write into a string constant, but
  1671. only if you have been very careful about using \c
  1672. .B const\c
  1673. \& in
  1674. declarations and prototypes.  Otherwise, it will just be a nuisance;
  1675. this is why we did not make `\|\c
  1676. .B \-Wall\c
  1677. \&\|' request these warnings.
  1678. .TP
  1679. .B \-Wconversion
  1680. Warn if a prototype causes a type conversion that is different from what
  1681. would happen to the same argument in the absence of a prototype.  This
  1682. includes conversions of fixed point to floating and vice versa, and
  1683. conversions changing the width or signedness of a fixed point argument
  1684. except when the same as the default promotion.
  1685. .TP
  1686. .B \-Waggregate\-return
  1687. Warn if any functions that return structures or unions are defined or
  1688. called.  (In languages where you can return an array, this also elicits
  1689. a warning.)
  1690. .TP
  1691. .B \-Wstrict\-prototypes
  1692. Warn if a function is declared or defined without specifying the
  1693. argument types.  (An old-style function definition is permitted without
  1694. a warning if preceded by a declaration which specifies the argument
  1695. types.)
  1696. .TP
  1697. .B \-Wmissing\-prototypes
  1698. Warn if a global function is defined without a previous prototype
  1699. declaration.  This warning is issued even if the definition itself
  1700. provides a prototype.  The aim is to detect global functions that fail
  1701. to be declared in header files.
  1702. .TP
  1703. .B \-Wenum\-clash
  1704. .I (C++ only.)
  1705. Warn when converting between different enumeration types.
  1706. .TP
  1707. .B \-Woverloaded\-virtual
  1708. .I (C++ only.)
  1709. In a derived class, the definitions of virtual functions must match
  1710. the type signature of a virtual function declared in the base class.
  1711. Use this option to request warnings when a derived class declares a
  1712. function that may be an erroneous attempt to define a virtual
  1713. function: that is, warn when a function with the same name as a
  1714. virtual function in the base class, but with a type signature that
  1715. doesn't match any virtual functions from the base class.
  1716. .TP
  1717. .B \-Winline
  1718. Warn if a function can not be inlined, and either it was declared as inline,
  1719. or else the
  1720. .B \-finline\-functions
  1721. option was given.
  1722. .TP
  1723. .B \-Werror
  1724. Treat warnings as errors; abort compilation after any warning.
  1725. .PP
  1726.  
  1727. .SH DEBUGGING OPTIONS
  1728. GNU CC has various special options that are used for debugging
  1729. either your program or GCC:
  1730. .TP
  1731. .B \-g
  1732. Produce debugging information in the operating system's native format
  1733. (for DBX or SDB or DWARF).  GDB also can work with this debugging
  1734. information.  On most systems that use DBX format, `\|\c
  1735. .B \-g\c
  1736. \&\|' enables use
  1737. of extra debugging information that only GDB can use; if you want to
  1738. control for certain whether to generate this information, use
  1739. `\|\c
  1740. .B \-ggdb\c
  1741. \&\|' or `\|\c
  1742. .B \-gdbx\c
  1743. \&\|'.
  1744.  
  1745. Unlike most other C compilers, GNU CC allows you to use `\|\c
  1746. .B \-g\c
  1747. \&\|' with
  1748. `\|\c
  1749. .B \-O\c
  1750. \&\|'.  The shortcuts taken by optimized code may occasionally
  1751. produce surprising results: some variables you declared may not exist
  1752. at all; flow of control may briefly move where you did not expect it;
  1753. some statements may not be executed because they compute constant
  1754. results or their values were already at hand; some statements may
  1755. execute in different places because they were moved out of loops.
  1756.  
  1757. Nevertheless it proves possible to debug optimized output.  This makes
  1758. it reasonable to use the optimizer for programs that might have bugs.
  1759.  
  1760. The following options are useful when GNU CC is configured and
  1761. compiled with the capability for more than one debugging format. 
  1762. .TP
  1763. .B \-ggdb
  1764. Produce debugging information in DBX format (if that is supported),
  1765. including GDB extensions.
  1766. .TP
  1767. .B \-gdbx
  1768. Produce debugging information in DBX format (if that is supported),
  1769. without GDB extensions.
  1770. .TP
  1771. .B \-gsdb
  1772. Produce debugging information in SDB format (if that is supported).
  1773. .TP
  1774. .B \-gdwarf
  1775. Produce debugging information in DWARF format (if that is supported).
  1776. .PP
  1777. .BI "\-g" "level"
  1778. .br
  1779. .BI "\-ggdb" "level"
  1780. .br
  1781. .BI "\-gdbx" "level"
  1782. .br
  1783. .BI "\-gsdb" "level"
  1784. .TP
  1785. .BI "\-gdwarf" "level"
  1786. Request debugging information and also use \c
  1787. .I level\c
  1788. \& to specify how
  1789. much information.  The default level is 2.
  1790.  
  1791. Level 1 produces minimal information, enough for making backtraces in
  1792. parts of the program that you don't plan to debug.  This includes
  1793. descriptions of functions and external variables, but no information
  1794. about local variables and no line numbers.
  1795. .TP
  1796. .B \-p
  1797. Generate extra code to write profile information suitable for the
  1798. analysis program \c
  1799. .B prof\c
  1800. \&.
  1801. .TP
  1802. .B \-pg
  1803. Generate extra code to write profile information suitable for the
  1804. analysis program \c
  1805. .B gprof\c
  1806. \&.
  1807. .TP
  1808. .B \-a
  1809. Generate extra code to write profile information for basic blocks,
  1810. which will record the number of times each basic block is executed.
  1811. This data could be analyzed by a program like \c
  1812. .B tcov\c
  1813. \&.  Note,
  1814. however, that the format of the data is not what \c
  1815. .B tcov\c
  1816. \& expects.
  1817. Eventually GNU \c
  1818. .B gprof\c
  1819. \& should be extended to process this data.
  1820. .TP
  1821. .BI "\-d" "letters"\c
  1822. \&
  1823. Says to make debugging dumps during compilation at times specified by
  1824. \c
  1825. .I letters\c
  1826. \&.  This is used for debugging the compiler.  The file names
  1827. for most of the dumps are made by appending a word to the source file
  1828. name (e.g.  `\|\c
  1829. .B foo.c.rtl\c
  1830. \&\|' or `\|\c
  1831. .B foo.c.jump\c
  1832. \&\|').
  1833. .TP
  1834. .B \-dM
  1835. Dump all macro definitions, at the end of preprocessing, and write no
  1836. output.
  1837. .TP
  1838. .B \-dN
  1839. Dump all macro names, at the end of preprocessing.
  1840. .TP
  1841. .B \-dD
  1842. Dump all macro definitions, at the end of preprocessing, in addition to
  1843. normal output.
  1844. .TP
  1845. .B \-dy
  1846. Dump debugging information during parsing, to standard error.
  1847. .TP
  1848. .B \-dr
  1849. Dump after RTL generation, to `\|\c
  1850. .B \c
  1851. .I file\c
  1852. \&.rtl\c
  1853. \&\|'.
  1854. .TP
  1855. .B \-dx
  1856. Just generate RTL for a function instead of compiling it.  Usually used
  1857. with `\|\c
  1858. .B r\c
  1859. \&\|'.
  1860. .TP
  1861. .B \-dj
  1862. Dump after first jump optimization, to `\|\c
  1863. .B \c
  1864. .I file\c
  1865. \&.jump\c
  1866. \&\|'.
  1867. .TP
  1868. .B \-ds
  1869. Dump after CSE (including the jump optimization that sometimes
  1870. follows CSE), to `\|\c
  1871. .B \c
  1872. .I file\c
  1873. \&.cse\c
  1874. \&\|'.
  1875. .TP
  1876. .B \-dL
  1877. Dump after loop optimization, to `\|\c
  1878. .B \c
  1879. .I file\c
  1880. \&.loop\c
  1881. \&\|'.
  1882. .TP
  1883. .B \-dt
  1884. Dump after the second CSE pass (including the jump optimization that
  1885. sometimes follows CSE), to `\|\c
  1886. .B \c
  1887. .I file\c
  1888. \&.cse2\c
  1889. \&\|'.
  1890. .TP
  1891. .B \-df
  1892. Dump after flow analysis, to `\|\c
  1893. .B \c
  1894. .I file\c
  1895. \&.flow\c
  1896. \&\|'.
  1897. .TP
  1898. .B \-dc
  1899. Dump after instruction combination, to `\|\c
  1900. .B \c
  1901. .I file\c
  1902. \&.combine\c
  1903. \&\|'.
  1904. .TP
  1905. .B \-dS
  1906. Dump after the first instruction scheduling pass, to
  1907. `\|\c
  1908. .B \c
  1909. .I file\c
  1910. \&.sched\c
  1911. \&\|'.
  1912. .TP
  1913. .B \-dl
  1914. Dump after local register allocation, to `\|\c
  1915. .B \c
  1916. .I file\c
  1917. \&.lreg\c
  1918. \&\|'.
  1919. .TP
  1920. .B \-dg
  1921. Dump after global register allocation, to `\|\c
  1922. .B \c
  1923. .I file\c
  1924. \&.greg\c
  1925. \&\|'.
  1926. .TP
  1927. .B \-dR
  1928. Dump after the second instruction scheduling pass, to
  1929. `\|\c
  1930. .B \c
  1931. .I file\c
  1932. \&.sched2\c
  1933. \&\|'.
  1934. .TP
  1935. .B \-dJ
  1936. Dump after last jump optimization, to `\|\c
  1937. .B \c
  1938. .I file\c
  1939. \&.jump2\c
  1940. \&\|'.
  1941. .TP
  1942. .B \-dd
  1943. Dump after delayed branch scheduling, to `\|\c
  1944. .B \c
  1945. .I file\c
  1946. \&.dbr\c
  1947. \&\|'.
  1948. .TP
  1949. .B \-dk
  1950. Dump after conversion from registers to stack, to `\|\c
  1951. .B \c
  1952. .I file\c
  1953. \&.stack\c
  1954. \&\|'.
  1955. .TP
  1956. .B \-dm
  1957. Print statistics on memory usage, at the end of the run, to
  1958. standard error.
  1959. .TP
  1960. .B \-dp
  1961. Annotate the assembler output with a comment indicating which
  1962. pattern and alternative was used.
  1963. .TP
  1964. .B \-fpretend\-float
  1965. When running a cross-compiler, pretend that the target machine uses the
  1966. same floating point format as the host machine.  This causes incorrect
  1967. output of the actual floating constants, but the actual instruction
  1968. sequence will probably be the same as GNU CC would make when running on
  1969. the target machine.
  1970. .TP
  1971. .B \-save\-temps
  1972. Store the usual ``temporary'' intermediate files permanently; place them
  1973. in the current directory and name them based on the source file.  Thus,
  1974. compiling `\|\c
  1975. .B foo.c\c
  1976. \&\|' with `\|\c
  1977. .B \-c \-save\-temps\c
  1978. \&\|' would produce files
  1979. `\|\c
  1980. .B foo.cpp\c
  1981. \&\|' and `\|\c
  1982. .B foo.s\c
  1983. \&\|', as well as `\|\c
  1984. .B foo.o\c
  1985. \&\|'.
  1986. .PP
  1987.  
  1988. .SH OPTIMIZATION OPTIONS
  1989. These options control various sorts of optimizations:
  1990. .TP
  1991. .B \-O
  1992. Optimize.  Optimizing compilation takes somewhat more time, and a lot
  1993. more memory for a large function.
  1994.  
  1995. Without `\|\c
  1996. .B \-O\c
  1997. \&\|', the compiler's goal is to reduce the cost of
  1998. compilation and to make debugging produce the expected results.
  1999. Statements are independent: if you stop the program with a breakpoint
  2000. between statements, you can then assign a new value to any variable or
  2001. change the program counter to any other statement in the function and
  2002. get exactly the results you would expect from the source code.
  2003.  
  2004. Without `\|\c
  2005. .B \-O\c
  2006. \&\|', only variables declared \c
  2007. .B register\c
  2008. \& are
  2009. allocated in registers.  The resulting compiled code is a little worse
  2010. than produced by PCC without `\|\c
  2011. .B \-O\c
  2012. \&\|'.
  2013.  
  2014. With `\|\c
  2015. .B \-O\c
  2016. \&\|', the compiler tries to reduce code size and execution
  2017. time.
  2018.  
  2019. When you specify `\|\c
  2020. .B \-O\c
  2021. \&\|', `\|\c
  2022. .B \-fthread\-jumps\c
  2023. \&\|' and
  2024. `\|\c
  2025. .B \-fdelayed\-branch\c
  2026. \&\|' are turned on.  On some machines other
  2027. flags may also be turned on.
  2028. .TP
  2029. .B \-O2
  2030. Highly optimize.  As compared to `\|\c
  2031. .B \-O\c
  2032. \&\|', this
  2033. option will increase both compilation time and the performance of the
  2034. generated code.
  2035.  
  2036. All `\|\c
  2037. .B \-f\c
  2038. .I flag\c
  2039. \&\c
  2040. \&\|' options that control optimization are turned on
  2041. when you specify `\|\c
  2042. .B \-O2\c
  2043. \&\|', except `\|\c
  2044. .B \-funroll\-loops\c
  2045. \&\|'
  2046. and `\|\c
  2047. .B \-funroll\-all\-loops\c
  2048. \&\|'.  
  2049. .PP
  2050.  
  2051. Options of the form `\|\c
  2052. .B \-f\c
  2053. .I flag\c
  2054. \&\c
  2055. \&\|' specify machine-independent
  2056. flags.  Most flags have both positive and negative forms; the negative
  2057. form of `\|\c
  2058. .B \-ffoo\c
  2059. \&\|' would be `\|\c
  2060. .B \-fno\-foo\c
  2061. \&\|'.  The following list shows
  2062. only one form\(em\&the one which is not the default.
  2063. You can figure out the other form by either removing `\|\c
  2064. .B no\-\c
  2065. \&\|' or
  2066. adding it.
  2067. .TP
  2068. .B \-ffloat\-store
  2069. Do not store floating point variables in registers.  This
  2070. prevents undesirable excess precision on machines such as the
  2071. 68000 where the floating registers (of the 68881) keep more
  2072. precision than a \c
  2073. .B double\c
  2074. \& is supposed to have.
  2075.  
  2076. For most programs, the excess precision does only good, but a few
  2077. programs rely on the precise definition of IEEE floating point.
  2078. Use `\|\c
  2079. .B \-ffloat\-store\c
  2080. \&\|' for such programs.
  2081. .TP
  2082. .B \-fmemoize\-lookups
  2083. .TP
  2084. .B \-fsave\-memoized
  2085. .I
  2086. (C++ only.)
  2087. These flags are used to get the compiler to compile programs faster
  2088. using heuristics.  They are not on by default since they are only effective
  2089. about half the time.  The other half of the time programs compile more
  2090. slowly (and take more memory).
  2091.  
  2092. The first time the compiler must build a call to a member function (or
  2093. reference to a data member), it must (1) determine whether the class
  2094. implements member functions of that name; (2) resolve which member
  2095. function to call (which involves figuring out what sorts of type
  2096. conversions need to be made); and (3) check the visibility of the member
  2097. function to the caller.  All of this adds up to slower compilation.
  2098. Normally, the second time a call is made to that member function (or
  2099. reference to that data member), it must go through the same lengthy
  2100. process again.  This means that code like this
  2101. .sp
  2102. .br
  2103. \ \ cout\ <<\ "This\ "\ <<\ p\ <<\ "\ has\ "\ <<\ n\ <<\ "\ legs.\en";
  2104. .br
  2105. .sp
  2106. makes six passes through all three steps.  By using a software cache,
  2107. a ``hit'' significantly reduces this cost.  Unfortunately, using the
  2108. cache introduces another layer of mechanisms which must be implemented,
  2109. and so incurs its own overhead.  `\|\c
  2110. .B \-fmemoize\-lookups\c
  2111. \&\|' enables
  2112. the software cache.
  2113.  
  2114. Because access privileges (visibility) to members and member functions
  2115. may differ from one function context to the next, 
  2116. .B g++
  2117. may need to flush the cache. With the `\|\c
  2118. .B \-fmemoize\-lookups\c
  2119. \&\|' flag, the cache is flushed after every
  2120. function that is compiled.  The `\|\c
  2121. \-fsave\-memoized\c
  2122. \&\|' flag enables the same software cache, but when the compiler
  2123. determines that the context of the last function compiled would yield
  2124. the same access privileges of the next function to compile, it
  2125. preserves the cache. 
  2126. This is most helpful when defining many member functions for the same
  2127. class: with the exception of member functions which are friends of
  2128. other classes, each member function has exactly the same access
  2129. privileges as every other, and the cache need not be flushed.
  2130. .TP
  2131. .B \-fno\-default\-inline
  2132. .I
  2133. (C++ only.)
  2134. If `\|\c
  2135. .B \-fdefault\-inline\c
  2136. \&\|' is enabled then member functions defined inside class
  2137. scope are compiled inline by default; i.e., you don't need to
  2138. add `\|\c
  2139. .B inline\c
  2140. \&\|' in front of the member function name.  By popular
  2141. demand, this option is now the default.  To keep GNU C++ from inlining
  2142. these member functions, specify `\|\c
  2143. .B \-fno\-default\-inline\c
  2144. \&\|'.
  2145. .TP
  2146. .B \-fno\-defer\-pop
  2147. Always pop the arguments to each function call as soon as that
  2148. function returns.  For machines which must pop arguments after a
  2149. function call, the compiler normally lets arguments accumulate on the
  2150. stack for several function calls and pops them all at once.
  2151. .TP
  2152. .B \-fforce\-mem
  2153. Force memory operands to be copied into registers before doing
  2154. arithmetic on them.  This may produce better code by making all
  2155. memory references potential common subexpressions.  When they are
  2156. not common subexpressions, instruction combination should
  2157. eliminate the separate register-load.  I am interested in hearing
  2158. about the difference this makes.
  2159. .TP
  2160. .B \-fforce\-addr
  2161. Force memory address constants to be copied into registers before
  2162. doing arithmetic on them.  This may produce better code just as
  2163. `\|\c
  2164. .B \-fforce\-mem\c
  2165. \&\|' may.  I am interested in hearing about the
  2166. difference this makes.
  2167. .TP
  2168. .B \-fomit\-frame\-pointer
  2169. Don't keep the frame pointer in a register for functions that
  2170. don't need one.  This avoids the instructions to save, set up and
  2171. restore frame pointers; it also makes an extra register available
  2172. in many functions.  \c
  2173. .I It also makes debugging impossible on
  2174. most machines.\c
  2175. \&
  2176.  
  2177. On some machines, such as the Vax, this flag has no effect, because
  2178. the standard calling sequence automatically handles the frame pointer
  2179. and nothing is saved by pretending it doesn't exist.  The
  2180. machine-description macro \c
  2181. .B FRAME_POINTER_REQUIRED\c
  2182. \& controls
  2183. whether a target machine supports this flag.  
  2184. .TP
  2185. .B \-finline
  2186. Pay attention the \c
  2187. .B inline\c
  2188. \& keyword.  Normally the negation of this
  2189. option `\|\c
  2190. .B \-fno\-inline\c
  2191. \&\|' is used to keep the compiler from expanding
  2192. any functions inline.  However, the opposite effect may be desirable
  2193. when compiling with `\|\c
  2194. .B \-g\c
  2195. \&\|', since `\|\c
  2196. .B \-g\c
  2197. \&\|' normally turns off all
  2198. inline function expansion.
  2199. .TP
  2200. .B \-finline\-functions
  2201. Integrate all simple functions into their callers.  The compiler
  2202. heuristically decides which functions are simple enough to be worth
  2203. integrating in this way.
  2204.  
  2205. If all calls to a given function are integrated, and the function is
  2206. declared \c
  2207. .B static\c
  2208. \&, then GCC normally does not output the function as
  2209. assembler code in its own right.
  2210. .TP
  2211. .B \-fcaller\-saves
  2212. Enable values to be allocated in registers that will be clobbered by
  2213. function calls, by emitting extra instructions to save and restore the
  2214. registers around such calls.  Such allocation is done only when it
  2215. seems to result in better code than would otherwise be produced.
  2216.  
  2217. This option is enabled by default on certain machines, usually those
  2218. which have no call-preserved registers to use instead.
  2219. .TP
  2220. .B \-fkeep\-inline\-functions
  2221. Even if all calls to a given function are integrated, and the function
  2222. is declared \c
  2223. .B static\c
  2224. \&, nevertheless output a separate run-time
  2225. callable version of the function.
  2226. .TP
  2227. .B \-fno\-function\-cse
  2228. Do not put function addresses in registers; make each instruction that
  2229. calls a constant function contain the function's address explicitly.
  2230.  
  2231. This option results in less efficient code, but some strange hacks
  2232. that alter the assembler output may be confused by the optimizations
  2233. performed when this option is not used.
  2234. .PP
  2235.  
  2236. The following options control specific optimizations.  The `\|\c
  2237. .B \-O2\c
  2238. \&\|'
  2239. option turns on all of these optimizations except `\|\c
  2240. .B \-funroll\-loops\c
  2241. \&\|'
  2242. and `\|\c
  2243. .B \-funroll\-all\-loops\c
  2244. \&\|'.  
  2245.  
  2246. The `\|\c
  2247. .B \-O\c
  2248. \&\|' option usually turns on
  2249. the `\|\c
  2250. .B \-fthread\-jumps\c
  2251. \&\|' and `\|\c
  2252. .B \-fdelayed\-branch\c
  2253. \&\|' options, but
  2254. specific machines may change the default optimizations.
  2255.  
  2256. You can use the following flags in the rare cases when ``fine-tuning''
  2257. of optimizations to be performed is desired.
  2258. .TP
  2259. .B \-fstrength\-reduce
  2260. Perform the optimizations of loop strength reduction and
  2261. elimination of iteration variables.
  2262. .TP
  2263. .B \-fthread\-jumps
  2264. Perform optimizations where we check to see if a jump branches to a
  2265. location where another comparison subsumed by the first is found.  If
  2266. so, the first branch is redirected to either the destination of the
  2267. second branch or a point immediately following it, depending on whether
  2268. the condition is known to be true or false.
  2269. .TP
  2270. .B \-funroll\-loops
  2271. Perform the optimization of loop unrolling.  This is only done for loops
  2272. whose number of iterations can be determined at compile time or run time.
  2273. .TP
  2274. .B \-funroll\-all\-loops
  2275. Perform the optimization of loop unrolling.  This is done for all loops.
  2276. This usually makes programs run more slowly.
  2277. .TP
  2278. .B \-fcse\-follow\-jumps
  2279. In common subexpression elimination, scan through jump instructions in
  2280. certain cases.  This is not as powerful as completely global CSE, but
  2281. not as slow either.
  2282. .TP
  2283. .B \-frerun\-cse\-after\-loop
  2284. Re-run common subexpression elimination after loop optimizations has been
  2285. performed.  
  2286. .TP
  2287. .B \-felide\-constructors
  2288. .I
  2289. (C++ only.)
  2290. Use this option to instruct the compiler to be smarter about when it can
  2291. elide constructors.  Without this flag, GNU C++ and cfront both
  2292. generate effectively the same code for:
  2293. .sp
  2294. .br
  2295. A\ foo\ ();
  2296. .br
  2297. A\ x\ (foo\ ());\ \ \ //\ x\ initialized\ by\ `foo\ ()',\ no\ ctor\ called
  2298. .br
  2299. A\ y\ =\ foo\ ();\ \ \ //\ call\ to\ `foo\ ()'\ heads\ to\ temporary,
  2300. .br
  2301. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ y\ is\ initialized\ from\ the\ temporary.
  2302. .br
  2303. .sp
  2304. Note the difference!  With this flag, GNU C++ initializes `\|\c
  2305. .B y\c
  2306. \&\|' directly
  2307. from the call to 
  2308. .B foo ()
  2309. without going through a temporary.
  2310. .TP
  2311. .B \-fexpensive\-optimizations
  2312. Perform a number of minor optimizations that are relatively expensive.
  2313. .TP
  2314. .B \-fdelayed\-branch
  2315. If supported for the target machine, attempt to reorder instructions
  2316. to exploit instruction slots available after delayed branch
  2317. instructions.
  2318. .TP
  2319. .B \-fschedule\-insns
  2320. If supported for the target machine, attempt to reorder instructions to
  2321. eliminate execution stalls due to required data being unavailable.  This
  2322. helps machines that have slow floating point or memory load instructions
  2323. by allowing other instructions to be issued until the result of the load
  2324. or floating point instruction is required.
  2325. .TP
  2326. .B \-fschedule\-insns2
  2327. Similar to `\|\c
  2328. .B \-fschedule\-insns\c
  2329. \&\|', but requests an additional pass of
  2330. instruction scheduling after register allocation has been done.  This is
  2331. especially useful on machines with a relatively small number of
  2332. registers and where memory load instructions take more than one cycle.
  2333. .PP
  2334.  
  2335. .SH TARGET OPTIONS
  2336. By default, GNU CC compiles code for the same type of machine that you
  2337. are using.  However, it can also be installed as a cross-compiler, to
  2338. compile for some other type of machine.  In fact, several different
  2339. configurations of GNU CC, for different target machines, can be
  2340. installed side by side.  Then you specify which one to use with the
  2341. `\|\c
  2342. .B \-b\c
  2343. \&\|' option.
  2344.  
  2345. In addition, older and newer versions of GNU CC can be installed side
  2346. by side.  One of them (probably the newest) will be the default, but
  2347. you may sometimes wish to use another.
  2348. .TP
  2349. .BI "\-b " "machine"\c
  2350. \&
  2351. The argument \c
  2352. .I machine\c
  2353. \& specifies the target machine for compilation.
  2354. This is useful when you have installed GNU CC as a cross-compiler.
  2355.  
  2356. The value to use for \c
  2357. .I machine\c
  2358. \& is the same as was specified as the
  2359. machine type when configuring GNU CC as a cross-compiler.  For
  2360. example, if a cross-compiler was configured with `\|\c
  2361. .B configure
  2362. i386v\c
  2363. \&\|', meaning to compile for an 80386 running System V, then you
  2364. would specify `\|\c
  2365. .B \-b i386v\c
  2366. \&\|' to run that cross compiler.
  2367.  
  2368. When you do not specify `\|\c
  2369. .B \-b\c
  2370. \&\|', it normally means to compile for
  2371. the same type of machine that you are using.
  2372. .TP
  2373. .BI "\-V " "version"\c
  2374. \&
  2375. The argument \c
  2376. .I version\c
  2377. \& specifies which version of GNU CC to run.
  2378. This is useful when multiple versions are installed.  For example,
  2379. \c
  2380. .I version\c
  2381. \& might be `\|\c
  2382. .B 2.0\c
  2383. \&\|', meaning to run GNU CC version 2.0.
  2384.  
  2385. The default version, when you do not specify `\|\c
  2386. .B \-V\c
  2387. \&\|', is controlled
  2388. by the way GNU CC is installed.  Normally, it will be a version that
  2389. is recommended for general use.
  2390. .PP
  2391.  
  2392. .SH MACHINE DEPENDENT OPTIONS
  2393. Each of the target machine types can have its own special options,
  2394. starting with `\|\c
  2395. .B \-m\c
  2396. \&\|', to choose among various hardware models or
  2397. configurations\(em\&for example, 68010 vs 68020, floating coprocessor or
  2398. none.  A single installed version of the compiler can compile for any
  2399. model or configuration, according to the options specified.
  2400.  
  2401. These are the `\|\c
  2402. .B \-m\c
  2403. \&\|' options defined for the 68000 series:
  2404. .TP
  2405. .B \-m68020
  2406. .TP
  2407. .B \-mc68020
  2408. Generate output for a 68020 (rather than a 68000).  This is the
  2409. default if you use the unmodified sources.
  2410. .TP
  2411. .B \-m68000
  2412. .TP
  2413. .B \-mc68000
  2414. Generate output for a 68000 (rather than a 68020).
  2415. .TP
  2416. .B \-m68881
  2417. Generate output containing 68881 instructions for floating point.
  2418. This is the default if you use the unmodified sources.
  2419. .TP
  2420. .B \-mfpa
  2421. Generate output containing Sun FPA instructions for floating point.
  2422. .TP
  2423. .B \-msoft\-float
  2424. Generate output containing library calls for floating point.
  2425. .I
  2426. WARNING: 
  2427. the requisite libraries are not part of GNU CC.  Normally the
  2428. facilities of the machine's usual C compiler are used, but this can't
  2429. be done directly in cross-compilation.  You must make your own
  2430. arrangements to provide suitable library functions for cross-compilation.
  2431. .TP
  2432. .B \-mshort
  2433. Consider type \c
  2434. .B int\c
  2435. \& to be 16 bits wide, like \c
  2436. .B short int\c
  2437. \&.
  2438. .TP
  2439. .B \-mnobitfield
  2440. Do not use the bit-field instructions.  `\|\c
  2441. .B \-m68000\c
  2442. \&\|' implies
  2443. `\|\c
  2444. .B \-mnobitfield\c
  2445. \&\|'.
  2446. .TP
  2447. .B \-mbitfield
  2448. Do use the bit-field instructions.  `\|\c
  2449. .B \-m68020\c
  2450. \&\|' implies
  2451. `\|\c
  2452. .B \-mbitfield\c
  2453. \&\|'.  This is the default if you use the unmodified
  2454. sources.
  2455. .TP
  2456. .B \-mrtd
  2457. Use a different function-calling convention, in which functions
  2458. that take a fixed number of arguments return with the \c
  2459. .B rtd\c
  2460. \&
  2461. instruction, which pops their arguments while returning.  This
  2462. saves one instruction in the caller since there is no need to pop
  2463. the arguments there.
  2464.  
  2465. This calling convention is incompatible with the one normally
  2466. used on Unix, so you cannot use it if you need to call libraries
  2467. compiled with the Unix compiler.
  2468.  
  2469. Also, you must provide function prototypes for all functions that
  2470. take variable numbers of arguments (including \c
  2471. .B printf\c
  2472. \&);
  2473. otherwise incorrect code will be generated for calls to those
  2474. functions.
  2475.  
  2476. In addition, seriously incorrect code will result if you call a
  2477. function with too many arguments.  (Normally, extra arguments are
  2478. harmlessly ignored.)
  2479.  
  2480. The \c
  2481. .B rtd\c
  2482. \& instruction is supported by the 68010 and 68020
  2483. processors, but not by the 68000.
  2484. .PP
  2485.  
  2486. These `\|\c
  2487. .B \-m\c
  2488. \&\|' options are defined for the Vax:
  2489. .TP
  2490. .B \-munix
  2491. Do not output certain jump instructions (\c
  2492. .B aobleq\c
  2493. \& and so on)
  2494. that the Unix assembler for the Vax cannot handle across long
  2495. ranges.
  2496. .TP
  2497. .B \-mgnu
  2498. Do output those jump instructions, on the assumption that you
  2499. will assemble with the GNU assembler.
  2500. .TP
  2501. .B \-mg
  2502. Output code for g-format floating point numbers instead of d-format.
  2503. .PP
  2504.  
  2505. These `\|\c
  2506. .B \-m\c
  2507. \&\|' switches are supported on the Sparc:
  2508. .TP
  2509. .B \-mfpu
  2510. Generate output containing floating point instructions.  This is the
  2511. default if you use the unmodified sources.
  2512. .TP
  2513. .B \-mno\-epilogue
  2514. Generate separate return instructions for \c
  2515. .B return\c
  2516. \& statements.
  2517. This has both advantages and disadvantages; I don't recall what they
  2518. are.
  2519. .PP
  2520.  
  2521. These `\|\c
  2522. .B \-m\c
  2523. \&\|' options are defined for the Convex:
  2524. .TP
  2525. .B \-mc1
  2526. Generate output for a C1.  This is the default when the compiler is
  2527. configured for a C1.
  2528. .TP
  2529. .B \-mc2
  2530. Generate output for a C2.  This is the default when the compiler is
  2531. configured for a C2.
  2532. .TP
  2533. .B \-margcount
  2534. Generate code which puts an argument count in the word preceding each
  2535. argument list.  Some nonportable Convex and Vax programs need this word.
  2536. (Debuggers don't, except for functions with variable-length argument
  2537. lists; this info is in the symbol table.)
  2538. .TP
  2539. .B \-mnoargcount
  2540. Omit the argument count word.  This is the default if you use the
  2541. unmodified sources.
  2542. .PP
  2543.  
  2544. These `\|\c
  2545. .B \-m\c
  2546. \&\|' options are defined for the AMD Am29000:
  2547. .TP
  2548. .B \-mdw
  2549. Generate code that assumes the DW bit is set, i.e., that byte and
  2550. halfword operations are directly supported by the hardware.  This is the
  2551. default.
  2552. .TP
  2553. .B \-mnodw
  2554. Generate code that assumes the DW bit is not set.
  2555. .TP
  2556. .B \-mbw
  2557. Generate code that assumes the system supports byte and halfword write
  2558. operations.  This is the default.
  2559. .TP
  2560. .B \-mnbw
  2561. Generate code that assumes the systems does not support byte and
  2562. halfword write operations.  This implies `\|\c
  2563. .B \-mnodw\c
  2564. \&\|'.
  2565. .TP
  2566. .B \-msmall
  2567. Use a small memory model that assumes that all function addresses are
  2568. either within a single 256 KB segment or at an absolute address of less
  2569. than 256K.  This allows the \c
  2570. .B call\c
  2571. \& instruction to be used instead
  2572. of a \c
  2573. .B const\c
  2574. \&, \c
  2575. .B consth\c
  2576. \&, \c
  2577. .B calli\c
  2578. \& sequence.
  2579. .TP
  2580. .B \-mlarge
  2581. Do not assume that the \c
  2582. .B call\c
  2583. \& instruction can be used; this is the
  2584. default.
  2585. .TP
  2586. .B \-m29050
  2587. Generate code for the Am29050.
  2588. .TP
  2589. .B \-m29000
  2590. Generate code for the Am29000.  This is the default.
  2591. .TP
  2592. .B \-mkernel\-registers
  2593. Generate references to registers \c
  2594. .B gr64-gr95\c
  2595. \& instead of
  2596. \c
  2597. .B gr96-gr127\c
  2598. \&.  This option can be used when compiling kernel code
  2599. that wants a set of global registers disjoint from that used by
  2600. user-mode code.
  2601.  
  2602. Note that when this option is used, register names in `\|\c
  2603. .B \-f\c
  2604. \&\|' flags
  2605. must use the normal, user-mode, names.
  2606. .TP
  2607. .B \-muser\-registers
  2608. Use the normal set of global registers, \c
  2609. .B gr96-gr127\c
  2610. \&.  This is the
  2611. default.
  2612. .TP
  2613. .B \-mstack\-check
  2614. Insert a call to \c
  2615. .B __msp_check\c
  2616. \& after each stack adjustment.  This
  2617. is often used for kernel code.
  2618. .PP
  2619.  
  2620. These `\|\c
  2621. .B \-m\c
  2622. \&\|' options are defined for Motorola 88K architectures:
  2623. .TP
  2624. .B \-mbig\-pic
  2625. Emit position-independent code, suitable for dynamic linking, even if
  2626. branches need large displacements.  Equivalent to the general-use option `\|\c
  2627. .B \-fPIC\c
  2628. \&\|'.
  2629. The general-use option `\|\c
  2630. .B \-fpic\c
  2631. \&\|',
  2632. by contrast, only emits valid 88k code if all branches involve small
  2633. displacements. 
  2634. GCC does not emit position-independent code by default.
  2635. .TP
  2636. .B \-midentify\-revision
  2637. Include an \c
  2638. .B ident\c
  2639. \& directive in the assembler output recording the
  2640. source file name, compiler name and version, timestamp, and compilation
  2641. flags used.
  2642. .TP
  2643. .B \-mno\-underscores
  2644. In assembler output, emit symbol names without adding an underscore
  2645. character at the beginning of each name.  The default is to use an
  2646. underscore as prefix on each name.
  2647. .TP
  2648. .B \-mno\-check\-zero\-division
  2649. .TP
  2650. .B \-mcheck\-zero\-division
  2651. Early models of the 88K architecture had problems with division by zero;
  2652. in particular, many of them didn't trap.  Use these options to avoid
  2653. including (or to include explicitly) additional code to detect division
  2654. by zero and signal an exception.  All GCC configurations for the 88K use
  2655. `\|\c
  2656. .B \-mcheck\-zero\-division\c
  2657. \&\|' by default.
  2658. .TP
  2659. .B \-mocs\-debug\-info
  2660. .TP
  2661. .B \-mno\-ocs\-debug\-info
  2662. Include (or omit) additional debugging information (about
  2663. registers used in each stack frame) as specified in the 88Open Object
  2664. Compatibility Standard, ``OCS''.  This extra information is not needed
  2665. by GDB.  The default for DG/UX, SVr4, and Delta 88 SVr3.2 is to
  2666. include this information; other 88k configurations omit this information
  2667. by default.
  2668. .TP
  2669. .B \-mocs\-frame\-position
  2670. .TP
  2671. .B \-mno\-ocs\-frame\-position
  2672. Force (or do not require) register values to be stored in a particular
  2673. place in stack frames, as specified in OCS.  The DG/UX, Delta88 SVr3.2,
  2674. and BCS configurations use `\|\c
  2675. .B \-mocs\-frame\-position\c
  2676. \&\|'; other 88k
  2677. configurations have the default `\|\c
  2678. .B \-mno\-ocs\-frame\-position\c
  2679. \&\|'.
  2680. .TP
  2681. .B \-moptimize\-arg\-area
  2682. .TP
  2683. .B \-mno\-optimize\-arg\-area
  2684. Control how to store function arguments in stack frames.
  2685. `\|\c
  2686. .B \-moptimize\-arg\-area\c
  2687. \&\|' saves space, but may break some
  2688. debuggers (not GDB).  `\|\c
  2689. .B \-mno\-optimize\-arg\-area\c
  2690. \&\|' conforms better to
  2691. standards.   By default GCC does not optimize the argument area.
  2692. .TP
  2693. .BI "\-mshort\-data\-" "num"\c
  2694. \&
  2695. .I num\c
  2696. \&
  2697. Generate smaller data references by making them relative to \c
  2698. .B r0\c
  2699. \&,
  2700. which allows loading a value using a single instruction (rather than the
  2701. usual two).  You control which data references are affected by
  2702. specifying \c
  2703. .I num\c
  2704. \& with this option.  For example, if you specify
  2705. `\|\c
  2706. .B \-mshort\-data\-512\c
  2707. \&\|', then the data references affected are those
  2708. involving displacements of less than 512 bytes.
  2709. `\|\c
  2710. .B \-mshort\-data\-\c
  2711. .I num\c
  2712. \&\c
  2713. \&\|' is not effective for \c
  2714. .I num\c
  2715. \& greater
  2716. than 64K.
  2717. .TP
  2718. .B \-msvr4
  2719. .TP
  2720. .B \-msvr3
  2721. Turn on (`\|\c
  2722. .B \-msvr4\c
  2723. \&\|') or off (`\|\c
  2724. .B \-msvr3\c
  2725. \&\|') compiler extensions
  2726. related to System V release 4 (SVr4).  This controls the following:
  2727. .TP
  2728. \ \ \ \(bu 
  2729. Which variant of the assembler syntax to emit (which you can select
  2730. independently using `\|\c
  2731. .B \-mversion03.00\c
  2732. \&\|').  
  2733. .TP
  2734. \ \ \ \(bu
  2735. `\|\c
  2736. .B \-msvr4\c
  2737. \&\|' makes the C preprocessor recognize `\|\c
  2738. .B #pragma weak\c
  2739. \&\|'
  2740. .TP
  2741. \ \ \ \(bu
  2742. `\|\c
  2743. .B \-msvr4\c
  2744. \&\|' makes GCC issue additional declaration directives used in
  2745. SVr4.  
  2746. .PP
  2747. `\|\c
  2748. .B \-msvr3\c
  2749. \&\|' is the default for all m88K configurations except
  2750. the SVr4 configuration.
  2751. .TP
  2752. .B \-mtrap\-large\-shift
  2753. .TP
  2754. .B \-mhandle\-large\-shift
  2755. Include code to detect bit-shifts of more than 31 bits; respectively,
  2756. trap such shifts or emit code to handle them properly.  By default GCC
  2757. makes no special provision for large bit shifts.
  2758. .TP
  2759. .B \-muse\-div\-instruction
  2760. Very early models of the 88K architecture didn't have a divide
  2761. instruction, so GCC avoids that instruction by default.  Use this option
  2762. to specify that it's safe to use the divide instruction.  
  2763. .TP
  2764. .B \-mversion\-03.00
  2765. Use alternative assembler syntax for the assembler version corresponding
  2766. to SVr4, but without enabling the other features triggered by
  2767. `\|\c
  2768. .B \-svr4\c
  2769. \&\|'.  This is implied by `\|\c
  2770. .B \-svr4\c
  2771. \&\|', is the default for the
  2772. SVr4 configuration of GCC, and is permitted by the DG/UX configuration
  2773. only if `\|\c
  2774. .B \-svr4\c
  2775. \&\|' is also specified.  The Delta 88 SVr3.2
  2776. configuration ignores this option.
  2777. .TP
  2778. .B \-mwarn\-passed\-structs
  2779. Warn when a function passes a struct as an argument or result.
  2780. Structure-passing conventions have changed during the evolution of the C
  2781. language, and are often the source of portability problems.  By default,
  2782. GCC issues no such warning.
  2783. .PP
  2784. These options are defined for the IBM RS6000:
  2785.  
  2786. .PP
  2787. .B \-mfp\-in\-toc
  2788. .TP
  2789. .B \-mno\-fp\-in\-toc
  2790. Control whether or not floating-point constants go in the Table of
  2791. Contents (TOC), a table of all global variable and function addresses.  By
  2792. default GCC puts floating-point constants there; if the TOC overflows,
  2793. `\|\c
  2794. .B \-mno\-fp\-in\-toc\c
  2795. \&\|' will reduce the size of the TOC, which may avoid
  2796. the overflow.
  2797.  
  2798. .PP
  2799. These `\|\c
  2800. .B \-m\c
  2801. \&\|' options are defined for the IBM RT PC:
  2802. .TP
  2803. .B \-min\-line\-mul
  2804. Use an in-line code sequence for integer multiplies.  This is the
  2805. default.
  2806. .TP
  2807. .B \-mcall\-lib\-mul
  2808. Call \c
  2809. .B lmul$$\c
  2810. \& for integer multiples.
  2811. .TP
  2812. .B \-mfull\-fp\-blocks
  2813. Generate full-size floating point data blocks, including the minimum
  2814. amount of scratch space recommended by IBM.  This is the default.
  2815. .TP
  2816. .B \-mminimum\-fp\-blocks
  2817. Do not include extra scratch space in floating point data blocks.  This
  2818. results in smaller code, but slower execution, since scratch space must
  2819. be allocated dynamically.
  2820. .TP
  2821. .B \-mfp\-arg\-in\-fpregs
  2822. Use a calling sequence incompatible with the IBM calling convention in
  2823. which floating point arguments are passed in floating point registers.
  2824. Note that \c
  2825. .B varargs.h\c
  2826. \& and \c
  2827. .B stdargs.h\c
  2828. \& will not work with
  2829. floating point operands if this option is specified.
  2830. .TP
  2831. .B \-mfp\-arg\-in\-gregs
  2832. Use the normal calling convention for floating point arguments.  This is
  2833. the default.
  2834. .TP
  2835. .B \-mhc\-struct\-return
  2836. Return structures of more than one word in memory, rather than in a
  2837. register.  This provides compatibility with the MetaWare HighC (hc)
  2838. compiler.  Use `\|\c
  2839. .B \-fpcc\-struct\-return\c
  2840. \&\|' for compatibility with the
  2841. Portable C Compiler (pcc).
  2842. .TP
  2843. .B \-mnohc\-struct\-return
  2844. Return some structures of more than one word in registers, when
  2845. convenient.  This is the default.  For compatibility with the
  2846. IBM-supplied compilers, use either `\|\c
  2847. .B \-fpcc\-struct\-return\c
  2848. \&\|' or
  2849. `\|\c
  2850. .B \-mhc\-struct\-return\c
  2851. \&\|'.
  2852. .PP
  2853. These `\|\c
  2854. .B \-m\c
  2855. \&\|' options are defined for the MIPS family of computers:
  2856. .TP
  2857. .BI "\-mcpu=" "cpu-type"
  2858. Assume the defaults for the machine type 
  2859. .I cpu-type
  2860. when
  2861. scheduling instructions.  The default
  2862. .I cpu-type
  2863. is
  2864. .BR default ,
  2865. which picks the longest cycles times for any of the machines, in order
  2866. that the code run at reasonable rates on all MIPS cpu's.  Other
  2867. choices for
  2868. .I cpu-type
  2869. are
  2870. .BR r2000 ,
  2871. .BR r3000 ,
  2872. .BR r4000 ,
  2873. and
  2874. .BR r6000 .
  2875. While picking a specific
  2876. .I cpu-type
  2877. will schedule things appropriately for that particular chip, the
  2878. compiler will not generate any code that does not meet level 1 of the
  2879. MIPS ISA (instruction set architecture) without the
  2880. .B \-mips2
  2881. or
  2882. .B \-mips3
  2883. switches being used.
  2884. .TP
  2885. .B \-mips2
  2886. Issue instructions from level 2 of the MIPS ISA (branch likely, square
  2887. root instructions).  The 
  2888. .B \-mcpu=r4000
  2889. or
  2890. .B \-mcpu=r6000
  2891. switch must be used in conjunction with
  2892. .BR \-mips2 .
  2893. .TP
  2894. .B \-mips3
  2895. Issue instructions from level 3 of the MIPS ISA (64 bit instructions).
  2896. The
  2897. .B \-mcpu=r4000
  2898. switch must be used in conjunction with
  2899. .BR \-mips2 .
  2900. .TP
  2901. .B \-mint64
  2902. .TP
  2903. .B \-mlong64
  2904. .TP
  2905. .B \-mlonglong128
  2906. These options don't work at present.
  2907. .TP
  2908. .B \-mmips\-as
  2909. Generate code for the MIPS assembler, and invoke
  2910. .B mips\-tfile
  2911. to add normal debug information.  This is the default for all
  2912. platforms except for the OSF/1 reference platform, using the OSF/rose
  2913. object format.  If any of the
  2914. .BR \-ggdb ,
  2915. .BR \-gstabs ,
  2916. or
  2917. .B \-gstabs+
  2918. switches are used, the
  2919. .B mips\-tfile
  2920. program will encapsulate the stabs within MIPS ECOFF.
  2921. .TP
  2922. .B \-mgas
  2923. Generate code for the GNU assembler.  This is the default on the OSF/1
  2924. reference platform, using the OSF/rose object format.
  2925. .TP
  2926. .B \-mrnames
  2927. .TP
  2928. .B \-mno\-rnames
  2929. The
  2930. .B \-mrnames
  2931. switch says to output code using the MIPS software names for the
  2932. registers, instead of the hardware names (ie, 
  2933. .B a0
  2934. instead of
  2935. .BR $4 ).
  2936. The GNU assembler does not support the
  2937. .B \-mrnames
  2938. switch, and the MIPS assembler will be instructed to run the MIPS C
  2939. preprocessor over the source file.  The
  2940. .B \-mno\-rnames
  2941. switch is default.
  2942. .TP
  2943. .B \-mgpopt
  2944. .TP
  2945. .B \-mno\-gpopt
  2946. The
  2947. .B \-mgpopt
  2948. switch says to write all of the data declarations before the
  2949. instructions in the text section, to all the MIPS assembler to
  2950. generate one word memory references instead of using two words for
  2951. short global or static data items.  This is on by default if
  2952. optimization is selected.
  2953. .TP
  2954. .B \-mstats
  2955. .TP
  2956. .B \-mno\-stats
  2957. For each non-inline function processed, the
  2958. .B \-mstats
  2959. switch causes the compiler to emit one line to the standard error file
  2960. to print statistics about the program (number of registers saved,
  2961. stack size, etc.).
  2962. .TP
  2963. .B \-mmemcpy
  2964. .TP
  2965. .B \-mno\-memcpy
  2966. The
  2967. .B \-mmemcpy
  2968. switch makes all block moves call the appropriate string function
  2969. .RB ( memcpy
  2970. or
  2971. .BR bcopy )
  2972. instead of possibly generating inline code.
  2973. .TP
  2974. .B \-mmips\-tfile
  2975. .TP
  2976. .B \-mno\-mips\-tfile
  2977. The
  2978. .B \-mno\-mips\-tfile
  2979. switch causes the compiler not postprocess the object file with the
  2980. .B mips\-tfile
  2981. program, after the MIPS assembler has generated it to add debug
  2982. support.  If
  2983. .B mips\-tfile
  2984. is not run, then no local variables will be available to the debugger.
  2985. In addition,
  2986. .B stage2
  2987. and
  2988. .B stage3
  2989. objects will have the temporary file names passed to the assembler
  2990. embedded in the object file, which means the objects will not compare
  2991. the same.
  2992. .TP
  2993. .B \-msoft\-float
  2994. Generate output containing library calls for floating point.
  2995. .I
  2996. WARNING: 
  2997. the requisite libraries are not part of GNU CC.  Normally the
  2998. facilities of the machine's usual C compiler are used, but this can't
  2999. be done directly in cross-compilation.  You must make your own
  3000. arrangements to provide suitable library functions for cross-compilation.
  3001. .TP
  3002. .B \-mhard\-float
  3003. Generate output containing floating point instructions.  This is the
  3004. default if you use the unmodified sources.
  3005. .TP
  3006. .B \-mfp64
  3007. Assume that the
  3008. .B FR
  3009. bit in the status word is on, and that there are 32 64-bit floating
  3010. point registers, instead of 32 32-bit floating point registers.  You
  3011. must also specify the
  3012. .B \-mcpu=r4000
  3013. and
  3014. .B \-mips3
  3015. switches.
  3016. .TP
  3017. .B \-mfp32
  3018. Assume that there are 32 32-bit floating point registers.  This is the
  3019. default.
  3020. .TP
  3021. .B \-mabicalls
  3022. The
  3023. .B \-mabicalls
  3024. switch says to emit the
  3025. .BR \&.abicalls ,
  3026. .BR \&.cpload ,
  3027. and
  3028. .B \&.cprestore
  3029. pseudo operations that some System V.4 ports use for position
  3030. independent code.
  3031. .TP
  3032. .B \-mhalf\-pic
  3033. .TP
  3034. .B \-mno\-half\-pic
  3035. The
  3036. .B \-mhalf\-pic
  3037. switch says to put pointers to extern references into the data section
  3038. and load them up, rather than put the references in the text section.
  3039. This option does not work at present.
  3040. .B
  3041. .BI \-G num
  3042. Put global and static items less than or equal to 
  3043. .I num
  3044. bytes into the small data or bss sections instead of the normal data
  3045. or bss section.  This allows the assembler to emit one word memory
  3046. reference instructions based on the global pointer
  3047. .RB ( gp
  3048. or
  3049. .BR $28 ),
  3050. instead of the normal two words used.  By default,
  3051. .I num
  3052. is 8 when the MIPS assembler is used, and 0 when the GNU
  3053. assembler is used.  The
  3054. .BI \-G num
  3055. switch is also passed to the assembler and linker.  All modules should
  3056. be compiled with the same
  3057. .BI \-G num
  3058. value.
  3059. .PP
  3060.  
  3061. .SH CODE GENERATION OPTIONS
  3062. These machine-independent options control the interface conventions
  3063. used in code generation.
  3064.  
  3065. Most of them begin with `\|\c
  3066. \-f\c
  3067. \&\|'.  These options have both positive and negative forms; the negative form
  3068. of `\|\c
  3069. .B \-ffoo\c
  3070. \&\|' would be `\|\c
  3071. .B \-fno\-foo\c
  3072. \&\|'.  In the table below, only
  3073. one of the forms is listed\(em\&the one which is not the default.  You
  3074. can figure out the other form by either removing `\|\c
  3075. .B no\-\c
  3076. \&\|' or adding
  3077. it.
  3078. .TP
  3079. .BI +e N
  3080. .I (C++ only.)
  3081. control whether virtual function definitions in classes
  3082. are used to generate code, or only to define interfaces for their
  3083. callers.  These options are provided for compatibility with cfront
  3084. 1.x usage; the recommended GNU C++ usage is to use 
  3085. .B #pragma interface
  3086. and 
  3087. .B
  3088. #pragma implementation\c
  3089. \&, instead.
  3090.  
  3091. With `\|\c
  3092. .B +e0\c
  3093. \&\|', virtual function definitions in classes are declared extern;
  3094. the declaration is used only as an interface specification, not to
  3095. generate code for the virtual functions (in this compilation).
  3096.  
  3097. With `\|\c
  3098. .B +e1\c
  3099. \&\|', 
  3100. .B g++
  3101. actually generates the code implementing virtual functions
  3102. defined in the code, and makes them publicly visible.
  3103. .TP
  3104. .B \-fnonnull\-objects
  3105. .I
  3106. (C++ only.)
  3107. Normally, GNU C++ makes conservative assumptions about objects reached
  3108. through references.  For example, the compiler must check that `\|\c
  3109. .B a\c
  3110. \&\|' is not null in code like the following:
  3111. .br
  3112. \ \ \ \ obj\ &a\ =\ g\ ();
  3113. .br
  3114. \ \ \ \ a.f\ (2);
  3115. .br
  3116. Checking that references of this sort have non-null values requires
  3117. extra code, however, and it is unnecessary for many programs.  You can
  3118. use `\|\c
  3119. .B \-fnonnull\-objects\c
  3120. \&\|' to omit the checks for null, if your program doesn't require the
  3121. default checking.
  3122. .TP
  3123. .B \-fpcc\-struct\-return
  3124. Use the same convention for returning \c
  3125. .B struct\c
  3126. \& and \c
  3127. .B union\c
  3128. \&
  3129. values that is used by the usual C compiler on your system.  This
  3130. convention is less efficient for small structures, and on many
  3131. machines it fails to be reentrant; but it has the advantage of
  3132. allowing intercallability between GCC-compiled code and PCC-compiled
  3133. code.
  3134. .TP
  3135. .B \-fshort\-enums
  3136. Allocate to an \c
  3137. .B enum\c
  3138. \& type only as many bytes as it needs for the
  3139. declared range of possible values.  Specifically, the \c
  3140. .B enum\c
  3141. \& type
  3142. will be equivalent to the smallest integer type which has enough room.
  3143. .TP
  3144. .B \-fshort\-double
  3145. Use the same size for
  3146. .B double
  3147. as for
  3148. .B float
  3149. \&.
  3150. .TP
  3151. .B \-fshared\-data
  3152. Requests that the data and non-\c
  3153. .B const\c
  3154. \& variables of this
  3155. compilation be shared data rather than private data.  The distinction
  3156. makes sense only on certain operating systems, where shared data is
  3157. shared between processes running the same program, while private data
  3158. exists in one copy per process.
  3159. .TP
  3160. .B \-fno\-common
  3161. Allocate even uninitialized global variables in the bss section of the
  3162. object file, rather than generating them as common blocks.  This has the
  3163. effect that if the same variable is declared (without \c
  3164. .B extern\c
  3165. \&) in
  3166. two different compilations, you will get an error when you link them.
  3167. The only reason this might be useful is if you wish to verify that the
  3168. program will work on other systems which always work this way.
  3169. .TP
  3170. .B \-fvolatile
  3171. Consider all memory references through pointers to be volatile.
  3172. .TP
  3173. .B \-fpic
  3174. If supported for the target machines, generate position-independent code,
  3175. suitable for use in a shared library.
  3176. .TP
  3177. .B \-fPIC
  3178. If supported for the target machine, emit position-independent code,
  3179. suitable for dynamic linking, even if branches need large displacements.
  3180. .TP
  3181. .BI "\-ffixed\-" "reg"\c
  3182. \&
  3183. Treat the register named \c
  3184. .I reg\c
  3185. \& as a fixed register; generated code
  3186. should never refer to it (except perhaps as a stack pointer, frame
  3187. pointer or in some other fixed role).
  3188.  
  3189. \c
  3190. .I reg\c
  3191. \& must be the name of a register.  The register names accepted
  3192. are machine-specific and are defined in the \c
  3193. .B REGISTER_NAMES\c
  3194. \&
  3195. macro in the machine description macro file.
  3196.  
  3197. This flag does not have a negative form, because it specifies a
  3198. three-way choice.
  3199. .TP
  3200. .BI "\-fcall\-used\-" "reg"\c
  3201. \&
  3202. Treat the register named \c
  3203. .I reg\c
  3204. \& as an allocatable register that is
  3205. clobbered by function calls.  It may be allocated for temporaries or
  3206. variables that do not live across a call.  Functions compiled this way
  3207. will not save and restore the register \c
  3208. .I reg\c
  3209. \&.
  3210.  
  3211. Use of this flag for a register that has a fixed pervasive role in the
  3212. machine's execution model, such as the stack pointer or frame pointer,
  3213. will produce disastrous results.
  3214.  
  3215. This flag does not have a negative form, because it specifies a
  3216. three-way choice.
  3217. .TP
  3218. .BI "\-fcall\-saved\-" "reg"\c
  3219. \&
  3220. Treat the register named \c
  3221. .I reg\c
  3222. \& as an allocatable register saved by
  3223. functions.  It may be allocated even for temporaries or variables that
  3224. live across a call.  Functions compiled this way will save and restore
  3225. the register \c
  3226. .I reg\c
  3227. \& if they use it.
  3228.  
  3229. Use of this flag for a register that has a fixed pervasive role in the
  3230. machine's execution model, such as the stack pointer or frame pointer,
  3231. will produce disastrous results.
  3232.  
  3233. A different sort of disaster will result from the use of this flag for
  3234. a register in which function values may be returned.
  3235.  
  3236. This flag does not have a negative form, because it specifies a
  3237. three-way choice.
  3238. .TP
  3239. .B \-fgnu\-binutils
  3240. .TP
  3241. .B \-fno\-gnu\-binutils
  3242. .I
  3243. (C++ only.)
  3244. `\|\c
  3245. .B \-fgnu\-binutils
  3246. \&\|' (the default for most, but not all, platforms) makes GNU C++
  3247. emit extra information for static initialization and finalization.
  3248. This information has to be passed from the assembler to the GNU
  3249. linker.  Some assemblers won't pass this information; you must either
  3250. use GNU
  3251. .B as
  3252. or specify the option `\|\c
  3253. .B \-fno\-gnu\-binutils\c
  3254. \&\|'.
  3255.  
  3256. With `\|\c
  3257. .B \-fno\-gnu\-binutils\c
  3258. \&\|', you must use the program
  3259. .B collect
  3260. (part of the GCC distribution) for linking.
  3261. .PP
  3262.  
  3263. .SH PRAGMAS
  3264. Two `\|\c
  3265. .B #pragma\c
  3266. \&\|' directives are supported for GNU C++, to permit using the same
  3267. header file for two purposes: as a definition of interfaces to a given
  3268. object class, and as the full definition of the contents of that object class.
  3269. .TP
  3270. .B #pragma interface
  3271. .I (C++ only.)
  3272. Use this directive in header files that define object classes, to save
  3273. space in most of the object files that use those classes.  Normally,
  3274. local copies of certain information (backup copies of inline member
  3275. functions, debugging information, and the internal tables that
  3276. implement virtual functions) must be kept in each object file that
  3277. includes class definitions.  You can use this pragma to avoid such
  3278. duplication.  When a header file containing `\|\c
  3279. .B #pragma interface\c
  3280. \&\|' is included in a compilation, this auxiliary information
  3281. will not be generated (unless the main input source file itself uses
  3282. `\|\c
  3283. .B #pragma implementation\c
  3284. \&\|').  Instead, the object files will contain references to be
  3285. resolved at link time.  
  3286. .tr !"
  3287. .TP
  3288. .B #pragma implementation
  3289. .TP
  3290. .BI "#pragma implementation !" objects .h!
  3291. .I (C++ only.)
  3292. Use this pragma in a main input file, when you want full output from
  3293. included header files to be generated (and made globally visible).
  3294. The included header file, in turn, should use `\|\c
  3295. .B #pragma interface\c
  3296. \&\|'.  
  3297. Backup copies of inline member functions, debugging information, and
  3298. the internal tables used to implement virtual functions are all
  3299. generated in implementation files.
  3300.  
  3301. If you use `\|\c
  3302. .B #pragma implementation\c
  3303. \&\|' with no argument, it applies to an include file with the same
  3304. basename as your source file; for example, in `\|\c
  3305. .B allclass.cc\c
  3306. \&\|', `\|\c
  3307. .B #pragma implementation\c
  3308. \&\|' by itself is equivalent to `\|\c
  3309. .B 
  3310. #pragma implementation "allclass.h"\c
  3311. \&\|'.  Use the string argument if you want a single implementation
  3312. file to include code from multiple header files.  
  3313.  
  3314. There is no way to split up the contents of a single header file into
  3315. multiple implementation files. 
  3316. .SH FILES
  3317. .ta \w'LIBDIR/g++\-include 'u
  3318. file.c    C source file
  3319. .br
  3320. file.h    C header (preprocessor) file
  3321. .br
  3322. file.i    preprocessed C source file
  3323. .br
  3324. file.C    C++ source file
  3325. .br
  3326. file.cc    C++ source file
  3327. .br
  3328. file.cxx    C++ source file
  3329. .br
  3330. file.m    Objective-C source file
  3331. .br
  3332. file.s    assembly language file
  3333. .br
  3334. file.o    object file
  3335. .br
  3336. a.out    link edited output
  3337. .br
  3338. \fITMPDIR\fR/cc\(**    temporary files
  3339. .br
  3340. \fILIBDIR\fR/cpp    preprocessor
  3341. .br
  3342. \fILIBDIR\fR/cc1    compiler for C
  3343. .br
  3344. \fILIBDIR\fR/cc1plus    compiler for C++
  3345. .br
  3346. \fILIBDIR\fR/collect    linker front end needed on some machines
  3347. .br
  3348. \fILIBDIR\fR/libgcc.a    GCC subroutine library
  3349. .br
  3350. /lib/crt[01n].o    start-up routine
  3351. .br
  3352. \fILIBDIR\fR/ccrt0    additional start-up routine for C++
  3353. .br
  3354. /lib/libc.a    standard C library, see
  3355. .IR intro (3)
  3356. .br
  3357. /usr/include    standard directory for 
  3358. .B #include
  3359. files
  3360. .br
  3361. \fILIBDIR\fR/include    standard gcc directory for
  3362. .B #include
  3363. files
  3364. .br
  3365. \fILIBDIR\fR/g++\-include    additional g++ directory for
  3366. .B #include
  3367. .sp
  3368. .I LIBDIR
  3369. is usually
  3370. .B /usr/local/lib/\c
  3371. .IR machine / version .
  3372. .br
  3373. .I TMPDIR
  3374. comes from the environment variable 
  3375. .B TMPDIR
  3376. (default
  3377. .B /usr/tmp
  3378. if available, else
  3379. .B /tmp\c
  3380. \&).
  3381. .SH "SEE ALSO"
  3382. cpp(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1).
  3383. .br
  3384. .RB "`\|" gcc "\|', `\|" cpp \|', 
  3385. .RB `\| as \|', `\| ld \|',
  3386. and 
  3387. .RB `\| gdb \|'
  3388. entries in
  3389. .B info\c
  3390. \&.
  3391. .br
  3392. .I 
  3393. Using and Porting GNU CC (for version 2.0)\c
  3394. , Richard M. Stallman, November 1990; 
  3395. .I
  3396. The C Preprocessor\c
  3397. , Richard M. Stallman, July 1990;
  3398. .I 
  3399. Using GDB: A Guide to the GNU Source-Level Debugger\c
  3400. , Richard M. Stallman and Roland H. Pesch, December 1991;
  3401. .I
  3402. Using as: the GNU Assembler\c
  3403. , Dean Elsner, Jay Fenlason & friends, March 1991;
  3404. .I
  3405. gld: the GNU linker\c
  3406. , Steve Chamberlain and Roland Pesch, April 1991.
  3407.  
  3408. .SH BUGS
  3409. Report bugs to
  3410. .BR bug\-gcc@prep.ai.mit.edu .
  3411. Bugs tend actually to be fixed if they can be isolated, so it is in your
  3412. interest to report them in such a way that they can be easily reproduced.
  3413. .SH COPYING
  3414. Copyright (c) 1991 Free Software Foundation, Inc.
  3415. .PP
  3416. Permission is granted to make and distribute verbatim copies of
  3417. this manual provided the copyright notice and this permission notice
  3418. are preserved on all copies.
  3419. .PP
  3420. Permission is granted to copy and distribute modified versions of this
  3421. manual under the conditions for verbatim copying, provided that the
  3422. entire resulting derived work is distributed under the terms of a
  3423. permission notice identical to this one.
  3424. .PP
  3425. Permission is granted to copy and distribute translations of this
  3426. manual into another language, under the above conditions for modified
  3427. versions, except that this permission notice may be included in
  3428. translations approved by the Free Software Foundation instead of in
  3429. the original English.
  3430. .SH AUTHORS
  3431. See the GNU CC Manual for the contributors to GNU CC.
  3432.